Method Summary |
|
public boolean | add(Object o) Adds the specified element to this set if it is not already present.
Parameters: o - element to be added to this set. |
public void | add(int index, Object o) Adds the specified element to this set if it is not already present, at the specified index. |
public boolean | addAll(Collection c) Adds all of the elements in the specified collection to this set if they're not already present.
Parameters: c - collection whose elements are to be added to this set. |
public void | clear() Removes all of the elements from this set. |
public Object | clone() Returns a clone of the Set.
throws: CloneNotSupportedException - if cloning is not supported. |
public boolean | contains(Object o) Returns true if this set contains the specified element.
Parameters: o - element whose presence in this set is to be tested. |
public boolean | containsAll(Collection c) Returns true if this set contains all of the elements of the specified collection.
Parameters: c - collection to be checked for containment in this set. |
public boolean | equals(Object o) Compares the specified object with this set for equality.
Parameters: o - Object to be compared for equality with this set. |
public Object | get(int index) Returns the element from the specified position.
Parameters: index - The position from which the element is to be retrieved. |
public int | hashCode() Returns the hash code value for this set. |
public int | indexOf(Object o) Returns the index of the element in this set.
Parameters: o - The element whose index is to be found. |
public boolean | isEmpty() Returns true if this set contains no elements. |
public Iterator | iterator() Returns an iterator over the elements in this set. |
public boolean | remove(Object o) Removes the specified element from this set if it is present.
Parameters: o - object to be removed from this set, if present. |
public Object | remove(int index) Remove the element from the specified position.
Parameters: index - The position from which the element is to be removed. |
public boolean | removeAll(Collection c) Removes from this set all of its elements that are contained in the specified collection.
Parameters: c - collection that defines which elements will be removed from this set. |
public boolean | retainAll(Collection c) Retains only the elements in this set that are contained in the specified collection.
Parameters: c - collection that defines which elements this set will retain. |
public int | size() Returns the number of elements in this set. |
public Object[] | toArray() Returns an array containing all of the elements in this set. |
public Object[] | toArray(Object[] a) Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array.
Parameters: a - the array into which the elements of this set are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose. |