An implementation of the Collection interface that does not allow duplicate items. If a duplicate item is added to a HashSet via the addItem method, the object remains unchanged, meaning that the size before adding the duplicate will be the same as the size after.
asdk.HashSet
class
Method | Description |
addItem( item ) |
Adds the specified item within the HashSet if it is not already present. |
addAll( object ) |
Adds all the elements within the array or collection object into the HashSet if they are not already present. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
clear() |
Removes all of the items from the HashSet. |
containsItem( item ) |
A Boolean value indicating whether the specified item is stored in the HashSet. |
containsAllItems( items : Collection ) |
A Boolean value indicating whether all the items within the specified Collection are stored in the HashSet. |
getSize() |
Returns the total number of items stored within the HashSet |
isEmpty() |
A Boolean value indicating whether the HashSet is empty (true) or not (false). |
iterator() |
Returns an iterator that can traverse the items within the HashSet |
removeItem( item ) |
Removes the specified item from the HashSet. |
removeAllItems( items : Collection ) |
Removes all the items within the collection object from the HashSet. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
retainAllItems( items : Collection ) |
Retains all the items within the collection object within the HashSet and removes any items not in the collection. Returns true if the set is changed and false if the set is unchanged as a result of the call. |
setComparator( condition ) |
Sets the comparator for the HashSet; this allows for customizing how objects are compared by using various
implementations of the asdk.condition.IComparator interface. The default comparator is asdk.condition.ObjectComparator . |
toArray() |
Returns the items within the HashSet as an array. |
toString() |
Returns a string representation of the HashSet. |