|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractSet<java.lang.Long> org.elasticsearch.util.gnu.trove.decorator.TLongHashSetDecorator
public class TLongHashSetDecorator
Wrapper class to make a TLongHashSet conform to the java.util.Set API. This class simply decorates an underlying TLongHashSet 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 TLongHashSet |
_set
the wrapped primitive set |
Constructor Summary | |
---|---|
TLongHashSetDecorator()
FOR EXTERNALIZATION ONLY!! |
|
TLongHashSetDecorator(TLongHashSet set)
Creates a wrapper that decorates the specified primitive set. |
Method Summary | |
---|---|
boolean |
add(java.lang.Long value)
Inserts a value into the set. |
void |
clear()
Empties the set. |
TLongHashSetDecorator |
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. |
TLongHashSet |
getSet()
Returns a reference to the set wrapped by this decorator. |
boolean |
isEmpty()
Indicates whether set has any entries. |
java.util.Iterator<java.lang.Long> |
iterator()
Creates an iterator over the values of the set. |
void |
readExternal(java.io.ObjectInput in)
|
boolean |
remove(java.lang.Object value)
Deletes a value from the set. |
int |
size()
Returns the number of entries in the set. |
protected long |
unwrap(java.lang.Object value)
Unwraps a value |
protected java.lang.Long |
wrap(long k)
Wraps a value |
void |
writeExternal(java.io.ObjectOutput out)
|
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 TLongHashSet _set
Constructor Detail |
---|
public TLongHashSetDecorator()
public TLongHashSetDecorator(TLongHashSet set)
Method Detail |
---|
public TLongHashSet getSet()
public TLongHashSetDecorator clone()
clone
in class java.lang.Object
public boolean add(java.lang.Long value)
add
in interface java.util.Collection<java.lang.Long>
add
in interface java.util.Set<java.lang.Long>
add
in class java.util.AbstractCollection<java.lang.Long>
value
- true if the set was modified by the insertionpublic boolean equals(java.lang.Object other)
equals
in interface java.util.Collection<java.lang.Long>
equals
in interface java.util.Set<java.lang.Long>
equals
in class java.util.AbstractSet<java.lang.Long>
other
- an Object
value
public void clear()
clear
in interface java.util.Collection<java.lang.Long>
clear
in interface java.util.Set<java.lang.Long>
clear
in class java.util.AbstractCollection<java.lang.Long>
public boolean remove(java.lang.Object value)
remove
in interface java.util.Collection<java.lang.Long>
remove
in interface java.util.Set<java.lang.Long>
remove
in class java.util.AbstractCollection<java.lang.Long>
value
- an Object
value
public java.util.Iterator<java.lang.Long> iterator()
iterator
in interface java.lang.Iterable<java.lang.Long>
iterator
in interface java.util.Collection<java.lang.Long>
iterator
in interface java.util.Set<java.lang.Long>
iterator
in class java.util.AbstractCollection<java.lang.Long>
public int size()
size
in interface java.util.Collection<java.lang.Long>
size
in interface java.util.Set<java.lang.Long>
size
in class java.util.AbstractCollection<java.lang.Long>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<java.lang.Long>
isEmpty
in interface java.util.Set<java.lang.Long>
isEmpty
in class java.util.AbstractCollection<java.lang.Long>
protected java.lang.Long wrap(long k)
k
- value in the underlying set
protected long unwrap(java.lang.Object value)
value
- wrapped value
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |