gnu.trove.decorator
Class TShortHashSetDecorator
AbstractSet
gnu.trove.decorator.TShortHashSetDecorator
- Set
public class TShortHashSetDecorator
extends AbstractSet
implements Set
Wrapper class to make a TShortHashSet conform to the
java.util.Set API.
This class simply decorates an underlying TShortHashSet 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
protected TShortHashSet | _set - the wrapped primitive set
|
boolean | add(Short value) - Inserts a value into the set.
|
void | clear() - Empties the set.
|
TShortHashSetDecorator | clone() - Clones the underlying trove collection and returns the clone wrapped in a new
decorator instance.
|
boolean | equals(Object other) - Compares this set with another set for equality of their stored
entries.
|
TShortHashSet | getSet() - Returns a reference to the set wrapped by this decorator.
|
boolean | isEmpty() - Indicates whether set has any entries.
|
Iterator | iterator() - Creates an iterator over the values of the set.
|
boolean | remove(Object value) - Deletes a value from the set.
|
int | size() - Returns the number of entries in the set.
|
protected short | unwrap(Object value) - Unwraps a value
|
protected Short | wrap(short k) - Wraps a value
|
_set
protected TShortHashSet _set
the wrapped primitive set
TShortHashSetDecorator
public TShortHashSetDecorator(TShortHashSet set)
Creates a wrapper that decorates the specified primitive set.
add
public boolean add(Short value)
Inserts a value into the set.
value
- true if the set was modified by the insertion
clear
public void clear()
Empties the set.
clone
public TShortHashSetDecorator clone()
Clones the underlying trove collection and returns the clone wrapped in a new
decorator instance. This is a shallow clone except where primitives are
concerned.
equals
public boolean equals(Object other)
Compares this set with another set for equality of their stored
entries.
- true if the sets are identical
getSet
public TShortHashSet getSet()
Returns a reference to the set wrapped by this decorator.
isEmpty
public boolean isEmpty()
Indicates whether set has any entries.
iterator
public Iterator iterator()
Creates an iterator over the values of the set.
- an iterator with support for removals in the underlying set
remove
public boolean remove(Object value)
Deletes a value from the set.
- true if the set was modified
size
public int size()
Returns the number of entries in the set.
unwrap
protected short unwrap(Object value)
Unwraps a value
- an unwrapped representation of the value
wrap
protected Short wrap(short k)
Wraps a value
k
- value in the underlying set
- an Object representation of the value
GNU Trove is copyright B) 2001-2008 Eric D. Friedman. All Rights Reserved.