Top Description Fields Constructors Methods
org.hsqldb.lib

public Class HashSet<E>

extends BaseHashMap
implements Set<E>
Class Inheritance
All Implemented Interfaces
org.hsqldb.lib.Set, org.hsqldb.lib.Collection
Known Direct Subclasses
org.hsqldb.lib.OrderedHashSet
Imports
org.hsqldb.map.BaseHashMap

This class does not store null keys.
Author
Fred Toussi (fredt@users dot sourceforge.net)
Since
1.7.2
Version
2.7.3

Field Summary

Inherited from org.hsqldb.map.BaseHashMap:
ACCESS_MAXaccessCountaccessMinaccessTablecomparatoremptyObjectArrayhashIndexhasZeroKeyinitialCapacityintKeyOrValueintKeyTableintValueTableisAccessCountisIntKeyisIntValueisLastAccessCountisListisLongKeyisLongValueisMultiValueisNoValueisObjectKeyisObjectValueloadFactorlongKeyOrValuelongKeyTablelongValueTablemaxCapacityminimizeOnEmptyNO_PURGEnoKeyOrValueobjectKeyOrValueobjectKeyTableobjectValueTableobjectValueTable2objectValueTable3PURGE_ALLPURGE_HALFpurgePolicythresholdzeroKeyIndexzeroOrNullValueCount

Constructor Summary

AccessConstructor and Description
public
public
HashSet(int initialCapacity)

public
HashSet(int initialCapacity, ObjectComparator<E> comparator)

public
HashSet(E[] valueList)

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if added
add
(E
the element
key
)

Implements org.hsqldb.lib.Collection.add.

returns true if element is added

public boolean

Returns:

true if any element is added
addAll
(Collection<? extends E>
the Collection to add
c
)

Implements org.hsqldb.lib.Collection.addAll.

returns true if any element is added

public boolean

Returns:

true if any element is added
addAll
(E[]
the array of elements to add
keys
)

returns true if any element is added

public boolean

Returns:

true if any element was added
addAll
(E[]
array of keys to add
keys
,
int
first index to add
start
,
int
limit of index to add
limit
)

returns true if any added

public int
public boolean
public boolean
public E
get(E key)

public int
public E
getOrAdd(E key)

returns existing value or null if added can be used as an Object cache

public Iterator<E>
public boolean

Returns:

true if removed
remove
(E
Object to remove
key
)

Implements org.hsqldb.lib.Collection.remove.

returns true if removed

public boolean

Returns:

true if all removed
removeAll
(Collection<E>
Collection of elements to remove
c
)

returns true if all were removed

public boolean

Returns:

boolean
removeAll
(E[]
E[]
keys
)

returns true if all were removed

public <T> T[]
toArray(T[] a)

public Object[]
public String

Returns:

String representation
toString
()

Overrides java.lang.Object.toString.

Returns a String like "[Drei, zwei, Eins]", exactly like java.util.HashSet.

Inherited from org.hsqldb.map.BaseHashMap:
addMultiValaddOrRemoveObjectaddOrUpdateclearclonecontainsIntKeycontainsLongKeycontainsObjectKeycontainsValuecontainsValuecontainsValuegetAccessCountCeilinggetLookupgetLookupgetLookupgetLookupgetMultiValuesIteratorgetObjectLookupinsertRowisEmptymultiValueElementCountmultiValueKeyCountmultiValueKeysToArraynextLookuprehashremoveremoveMultiValremoveObjectremoveRowresetresetAccessCountsetAccessCountFloorsizetoArraytoArraytoIntArraytoLongArray

Constructor Detail

HashSetback to summary
public HashSet()
HashSetback to summary
public HashSet(int initialCapacity) throws IllegalArgumentException
HashSetback to summary
public HashSet(int initialCapacity, ObjectComparator<E> comparator) throws IllegalArgumentException
HashSetback to summary
public HashSet(E[] valueList)

Method Detail

addback to summary
public boolean add(E key)

Implements org.hsqldb.lib.Collection.add.

returns true if element is added

Parameters
key:E

the element

Returns:boolean

true if added

addAllback to summary
public boolean addAll(Collection<? extends E> c)

Implements org.hsqldb.lib.Collection.addAll.

returns true if any element is added

Parameters
c:Collection<? extends E>

the Collection to add

Returns:boolean

true if any element is added

addAllback to summary
public boolean addAll(E[] keys)

returns true if any element is added

Parameters
keys:E[]

the array of elements to add

Returns:boolean

true if any element is added

addAllback to summary
public boolean addAll(E[] keys, int start, int limit)

returns true if any added

Parameters
keys:E[]

array of keys to add

start:int

first index to add

limit:int

limit of index to add

Returns:boolean

true if any element was added

capacityback to summary
public int capacity()

Overrides org.hsqldb.map.BaseHashMap.capacity.

containsback to summary
public boolean contains(Object key)

Implements org.hsqldb.lib.Collection.contains.

containsAllback to summary
public boolean containsAll(Collection<E> col)
getback to summary
public E get(E key)
getCommonElementCountback to summary
public int getCommonElementCount(Set<E> other)
getOrAddback to summary
public E getOrAdd(E key)

returns existing value or null if added can be used as an Object cache

iteratorback to summary
public Iterator<E> iterator()

Implements org.hsqldb.lib.Collection.iterator.

removeback to summary
public boolean remove(E key)

Implements org.hsqldb.lib.Collection.remove.

returns true if removed

Parameters
key:E

Object to remove

Returns:boolean

true if removed

removeAllback to summary
public boolean removeAll(Collection<E> c)

returns true if all were removed

Parameters
c:Collection<E>

Collection of elements to remove

Returns:boolean

true if all removed

removeAllback to summary
public boolean removeAll(E[] keys)

returns true if all were removed

Parameters
keys:E[]

E[]

Returns:boolean

boolean

toArrayback to summary
public <T> T[] toArray(T[] a)
toArrayback to summary
public Object[] toArray()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a String like "[Drei, zwei, Eins]", exactly like java.util.HashSet.

Returns:String

String representation