New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

com.ochumak:mset-core

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.ochumak:mset-core

Mathematical sets in java.

  • 1.6
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

MSet

Mathematical sets in java.

Maven Central Build Status Coverage Status License

Examples

Creating MSet

MSet<Long> longSet = MSet.of(1L, 2L, 3L); //from array

ArrayList<String> strings = new ArrayList<>(); //from collection
strings.add("v1");
strings.add("v2");
MSet<String> stringSet = MSet.of(strings);

MSet<Integer> integerSet = IntStream.range(0, 10) //from stream
    .boxed()
    .collect(MSet.toMSet());

Iterating through set :

for (Integer value : set) { //foreach loop
    //...
}

set.stream()    //stream
.forEach(value -> { /* ... */});


Iterator<Integer> iterator = set.iterator(); //iterator
while (iterator.hasNext()) {
    Integer value = iterator.next();
    // ... 
}

Some set operations:

MSet.of(1, 2, 3).union(MSet.of(2, 3, 4)); //union {1,2,3,4}

MSet.of(1, 2, 3).intersection(MSet.of(2, 3, 4)); //intersection {2,3}

MSet.of(1, 2, 3).contains(1); // true
 
MSet.of(1, 2, 3).intersection(MSet.of(2, 3, 4)).contains(1); // false

Universal set bounded operations:

MSet.of(1, 2, 3)
.complement()
.contains(4, MSet.of(1, 2, 3, 4)) //true

MSet.of(1, 2, 3)
.complement()
.contains(1, MSet.of(1, 2, 3, 4)) //false

License

This project is licensed under Apache License, version 2.0

Installation

Releases are available in Maven Central

Maven

Add this snippet to the pom.xml dependencies section:

<dependency>
  <groupId>com.ochumak</groupId>
  <artifactId>mset-core</artifactId>
  <version>1.4</version>
</dependency>
Gradle

Add this snippet to the build.gradle dependencies section:

compile 'com.ochumak:mset-core:1.4'

Pull requests are welcome.

FAQs

Package last updated on 22 Sep 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc