T
- The type of the elements in the HashSet.java.util.Collection<T>
, DistributedDataStructure
, java.lang.Iterable<T>
, Lockable
, Notifiable
, java.util.Set<T>
public interface DistributedHashSet<T> extends java.util.Set<T>, DistributedDataStructure, Notifiable
Modifier and Type | Method | Description |
---|---|---|
void |
addRange(java.util.Collection<T> collection) |
Insert elements of the provided collection in DistributedHashSet.
|
void |
copyTo(T[] array,
int arrayIndex) |
Copies the HashSet elements to the specified array, starting at the specified index.
|
java.util.Collection<T> |
difference(java.lang.String other) |
Returns the difference of current set with the specified set.
|
T |
getRandom() |
Return a random element from the set.
|
T[] |
getRandom(int count) |
Returns count distinct random elements from the set.
|
java.util.Collection<T> |
intersect(java.lang.String other) |
Returns the intersection of current set with the specified set.
|
int |
remove(java.util.Collection<T> items) |
Remove the specified items from the set.
|
T |
removeRandom() |
Removes and returns a random element from the set.
|
DistributedHashSet<T> |
storeDifference(java.lang.String destination,
java.lang.String other) |
Take difference of current set with the specified set and store the result in a new destination set.
|
DistributedHashSet<T> |
storeIntersection(java.lang.String destination,
java.lang.String other) |
Take intersection of current set with the specified set and store the result in a new destination set.
|
DistributedHashSet<T> |
storeUnion(java.lang.String destination,
java.lang.String other) |
Take union of current set with the specified set and store the result in a new destination set.
|
java.util.Collection<T> |
union(java.lang.String other) |
Returns the union of current set with the specified set.
|
getKey, getWriteThruOptions, setWriteThruOptions
addChangeListener, removeChangeListener
void addRange(java.util.Collection<T> collection)
collection
- Elements to be inserted in the DistributedHashSet.void copyTo(T[] array, int arrayIndex)
array
- The destination array of the elements copied from Hashset.arrayIndex
- he zero-based index in array at which copying begins.T removeRandom()
T getRandom()
T[] getRandom(int count)
count
- Number of required elements.int remove(java.util.Collection<T> items)
items
- Items to remove from the set.java.util.Collection<T> union(java.lang.String other) throws CacheException
other
- Name of set to compare with.CacheException
java.util.Collection<T> intersect(java.lang.String other) throws CacheException
other
- Name of set to compare with.CacheException
java.util.Collection<T> difference(java.lang.String other) throws CacheException
other
- Name of set to compare with.CacheException
DistributedHashSet<T> storeUnion(java.lang.String destination, java.lang.String other) throws CacheException
destination
- Name of destination set.other
- Name of set to compare with.CacheException
DistributedHashSet<T> storeDifference(java.lang.String destination, java.lang.String other) throws CacheException
destination
- Name of destination set.other
- Name of set to compare with.CacheException
DistributedHashSet<T> storeIntersection(java.lang.String destination, java.lang.String other) throws CacheException
destination
- Name of destination set.other
- Name of set to compare with.CacheException