E - The type of element managed by the collection.public class Set<E> extends OrderedCollection<E>
| Constructor and Description |
|---|
Set()
This constructor creates a new empty set with no comparator function.
|
Set(java.util.Comparator<? super E> comparator)
This constructor creates a new set with the specified comparator function.
|
Set(E[] elements)
This constructor creates a new set with no comparator function and seeds
it with the elements from the specified array.
|
Set(E[] elements,
java.util.Comparator<? super E> comparator)
This constructor creates a new set with the specified comparator function and seeds
it with the elements from the specified array.
|
Set(java.lang.Iterable<? extends E> elements)
This constructor creates a new set with no comparator function and seeds
it with the elements from the specified collection.
|
Set(java.lang.Iterable<? extends E> elements,
java.util.Comparator<? super E> comparator)
This constructor creates a new set with the specified comparator function and seeds
it with the elements from the specified collection.
|
| Modifier and Type | Method and Description |
|---|---|
static <E> Set<E> |
and(Set<E> set1,
Set<E> set2)
This function returns a new set that contains the elements that are in
both the first set and the second set.
|
static <E> Set<E> |
or(Set<E> set1,
Set<E> set2)
This function returns a new set that contains all the elements that are in
the first set or the second set or both.
|
static <E> Set<E> |
sans(Set<E> set1,
Set<E> set2)
This function returns a new set that contains the elements that are in
the first set but not in the second set.
|
static <E> Set<E> |
xor(Set<E> set1,
Set<E> set2)
This function returns a new set that contains all the elements that are in
the first set or the second set but not both.
|
addElement, containsElement, createDefaultIterator, getNumberOfElements, removeAllElements, removeElementaddElements, addElements, containsAllElementsIn, containsAnyElementsIn, equals, hashCode, isEmpty, iterator, normalizedIndex, removeElements, removeElements, toArray, toString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitisEmpty, iterator, toArraypublic Set()
public Set(E[] elements)
elements - The elements to be used to seed the new set.public Set(java.lang.Iterable<? extends E> elements)
elements - The elements to be used to seed the new set.public Set(java.util.Comparator<? super E> comparator)
comparator - The comparator to be used to compare two elements during ordering.public Set(E[] elements, java.util.Comparator<? super E> comparator)
elements - The elements to be used to seed the new set.comparator - The comparator to be used to compare two elements during ordering.public Set(java.lang.Iterable<? extends E> elements, java.util.Comparator<? super E> comparator)
elements - The elements to be used to seed the new set.comparator - The comparator to be used to compare two elements during ordering.public static <E> Set<E> and(Set<E> set1, Set<E> set2)
E - The type of element contained in the sets.set1 - The first set to be operated on.set2 - The second set to be operated on.public static <E> Set<E> sans(Set<E> set1, Set<E> set2)
E - The type of element contained in the sets.set1 - The first set to be operated on.set2 - The second set to be operated on.public static <E> Set<E> or(Set<E> set1, Set<E> set2)
E - The type of element contained in the sets.set1 - The first set to be operated on.set2 - The second set to be operated on.public static <E> Set<E> xor(Set<E> set1, Set<E> set2)
E - The type of element contained in the sets.set1 - The first set to be operated on.set2 - The second set to be operated on.Copyright © 2014 Crater Dog Technologies(TM). All rights reserved.