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.
|
Set<E> |
copy() |
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.
|
E[] |
toArray() |
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, createDefaultIterator, getComparator, getElementAtIndex, getElementsInRange, getIndexOfElement, getNumberOfElements, removeAllElements, removeElementaddElements, addElements, removeElements, removeElementscompareTo, containsAllElementsIn, containsAnyElementsIn, containsElement, equals, hashCode, isEmpty, iterator, normalizedIndexaddSerializableClass, addSerializableClass, toExposedString, toString, toStringpublic 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 E[] toArray()
toArray in interface Sequential<E>toArray in class Collection<E>public Set<E> copy()
copy in class craterdog.smart.SmartObject<Collection<E>>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 © 2015 Crater Dog Technologies(TM). All rights reserved.