Package jade.util.leap
Class HashSet
- java.lang.Object
-
- jade.util.leap.HashSet
-
- All Implemented Interfaces:
Collection,Serializable,Set,Serializable,Cloneable
public class HashSet extends Object implements Set, Cloneable, Serializable
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HashSet()HashSet(int initialCapacity)HashSet(Collection c)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Object o)Adds an element.booleanaddAll(Collection c)voidclear()Objectclone()booleancontains(Object o)booleancontainsAll(Collection c)booleanequals(Object o)inthashCode()booleanisEmpty()Checks if the collection contains elements.Iteratoriterator()Returns an iterator over the elements in this collection.booleanremove(Object o)Removes one instance of the specified element.booleanremoveAll(Collection c)intsize()Returns the number of elements in this collection.Object[]toArray()Returns an array containing all of the elements in this collection.Object[]toArray(Object[] a)
-
-
-
Constructor Detail
-
HashSet
public HashSet()
-
HashSet
public HashSet(Collection c)
-
HashSet
public HashSet(int initialCapacity)
-
-
Method Detail
-
add
public boolean add(Object o)
Description copied from interface:CollectionAdds an element.- Specified by:
addin interfaceCollection- Returns:
- true if the element has been added.
-
isEmpty
public boolean isEmpty()
Description copied from interface:CollectionChecks if the collection contains elements.- Specified by:
isEmptyin interfaceCollection- Returns:
- true if this collection contains no elements
-
iterator
public Iterator iterator()
Description copied from interface:CollectionReturns an iterator over the elements in this collection. There are no guarantees concerning the order in which the elements are returned.- Specified by:
iteratorin interfaceCollection- Returns:
- an Iterator over the elements in this collection
-
remove
public boolean remove(Object o)
Description copied from interface:CollectionRemoves one instance of the specified element.- Specified by:
removein interfaceCollection- Parameters:
o- the element to be removed- Returns:
- true if the element has been removed
-
size
public int size()
Description copied from interface:CollectionReturns the number of elements in this collection.- Specified by:
sizein interfaceCollection- Returns:
- the number of elements in this collection.
-
toArray
public Object[] toArray()
Description copied from interface:CollectionReturns an array containing all of the elements in this collection.- Specified by:
toArrayin interfaceCollection- Returns:
- an array containing all of the elements in this collection
-
clear
public void clear()
-
contains
public boolean contains(Object o)
-
addAll
public boolean addAll(Collection c)
-
containsAll
public boolean containsAll(Collection c)
-
removeAll
public boolean removeAll(Collection c)
-
-