java.util
Class HashSet

java.lang.Object
  extended by java.util.AbstractCollection
      extended by java.util.AbstractSet
          extended by java.util.HashSet
All Implemented Interfaces:
Serializable, Cloneable, Collection, Set
Direct Known Subclasses:
LinkedHashSet


public class HashSet
extends AbstractSet
implements Set, Cloneable, Serializable

See Also:
Serialized Form

Constructor Summary
HashSet()
           
HashSet(Collection c)
           
HashSet(int initialCapacity)
           
 
Method Summary
 boolean add(Object o)
           
 void clear()
           
 Object clone()
           
 boolean contains(Object o)
           
 Iterator iterator()
           
 boolean remove(Object o)
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
 
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Set
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
 

Constructor Detail

HashSet

public HashSet()

HashSet

public HashSet(int initialCapacity)

HashSet

public HashSet(Collection c)
Method Detail

add

public boolean add(Object o)
Specified by:
add in interface Collection
Specified by:
add in interface Set
Overrides:
add in class AbstractCollection

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface Set
Overrides:
clear in class AbstractCollection

clone

public Object clone()
Overrides:
clone in class Object

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface Set
Overrides:
contains in class AbstractCollection

iterator

public Iterator iterator()
Specified by:
iterator in interface Collection
Specified by:
iterator in interface Set

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface Set
Overrides:
remove in class AbstractCollection

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface Set