|
GNU Trove | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--java.util.AbstractSet | +--gnu.trove.decorator.TDoubleHashSetDecorator
Wrapper class to make a TDoubleHashSet conform to the java.util.Set API. This class simply decorates an underlying TDoubleHashSet and translates the Object-based APIs into their Trove primitive analogs.
Note that wrapping and unwrapping primitive values is extremely inefficient. If possible, users of this class should override the appropriate methods in this class and use a table of canonical values.
Created: Tue Sep 24 22:08:17 PDT 2002
Field Summary | |
protected TDoubleHashSet |
_set
the wrapped primitive set |
Constructor Summary | |
TDoubleHashSetDecorator(TDoubleHashSet set)
Creates a wrapper that decorates the specified primitive set. |
Method Summary | |
boolean |
add(java.lang.Object value)
Inserts a value into the set. |
void |
clear()
Empties the set. |
java.lang.Object |
clone()
Clones the underlying trove collection and returns the clone wrapped in a new decorator instance. |
boolean |
equals(java.lang.Object other)
Compares this set with another set for equality of their stored entries. |
boolean |
isEmpty()
Indicates whether set has any entries. |
java.util.Iterator |
iterator()
Creates an iterator over the values of the set. |
boolean |
remove(java.lang.Object value)
Deletes a value from the set. |
int |
size()
Returns the number of entries in the set. |
protected double |
unwrap(java.lang.Object value)
Unwraps a value |
protected java.lang.Double |
wrap(double k)
Wraps a value |
Methods inherited from class java.util.AbstractSet |
hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
addAll, contains, containsAll, 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, contains, containsAll, hashCode, removeAll, retainAll, toArray, toArray |
Field Detail |
protected TDoubleHashSet _set
Constructor Detail |
public TDoubleHashSetDecorator(TDoubleHashSet set)
Method Detail |
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean add(java.lang.Object value)
add
in interface java.util.Set
add
in class java.util.AbstractCollection
public boolean equals(java.lang.Object other)
equals
in interface java.util.Set
equals
in class java.util.AbstractSet
other
- an Object
value
public void clear()
clear
in interface java.util.Set
clear
in class java.util.AbstractCollection
public boolean remove(java.lang.Object value)
remove
in interface java.util.Set
remove
in class java.util.AbstractCollection
value
- an Object
value
public java.util.Iterator iterator()
iterator
in interface java.util.Set
iterator
in class java.util.AbstractCollection
public int size()
size
in interface java.util.Set
size
in class java.util.AbstractCollection
public boolean isEmpty()
isEmpty
in interface java.util.Set
isEmpty
in class java.util.AbstractCollection
protected java.lang.Double wrap(double k)
protected double unwrap(java.lang.Object value)
|
GNU Trove | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |