public class TCharSetDecorator
extends java.util.AbstractSet<java.lang.Character>
implements java.util.Set<java.lang.Character>, java.io.Externalizable
Wrapper class to make a TCharSet conform to the java.util.Set API. This class simply decorates an underlying TCharSet 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| Modifier and Type | Field and Description |
|---|---|
protected TCharSet |
_set
the wrapped primitive set
|
| Constructor and Description |
|---|
TCharSetDecorator()
FOR EXTERNALIZATION ONLY!!
|
TCharSetDecorator(TCharSet set)
Creates a wrapper that decorates the specified primitive set.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(java.lang.Character value)
Inserts a value into the set.
|
void |
clear()
Empties the set.
|
boolean |
contains(java.lang.Object o) |
boolean |
equals(java.lang.Object other)
Compares this set with another set for equality of their stored
entries.
|
TCharSet |
getSet()
Returns a reference to the set wrapped by this decorator.
|
boolean |
isEmpty()
Indicates whether set has any entries.
|
java.util.Iterator<java.lang.Character> |
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.
|
void |
writeExternal(java.io.ObjectOutput out) |
addAll, containsAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitprotected TCharSet _set
public TCharSetDecorator()
public TCharSetDecorator(TCharSet set)
set - the TCharSet to wrap.public TCharSet getSet()
public boolean add(java.lang.Character value)
add in interface java.util.Collection<java.lang.Character>add in interface java.util.Set<java.lang.Character>add in class java.util.AbstractCollection<java.lang.Character>value - true if the set was modified by the insertionpublic boolean equals(java.lang.Object other)
equals in interface java.util.Collection<java.lang.Character>equals in interface java.util.Set<java.lang.Character>equals in class java.util.AbstractSet<java.lang.Character>other - an Object valuepublic void clear()
clear in interface java.util.Collection<java.lang.Character>clear in interface java.util.Set<java.lang.Character>clear in class java.util.AbstractCollection<java.lang.Character>public boolean remove(java.lang.Object value)
remove in interface java.util.Collection<java.lang.Character>remove in interface java.util.Set<java.lang.Character>remove in class java.util.AbstractCollection<java.lang.Character>value - an Object valuepublic java.util.Iterator<java.lang.Character> iterator()
iterator in interface java.lang.Iterable<java.lang.Character>iterator in interface java.util.Collection<java.lang.Character>iterator in interface java.util.Set<java.lang.Character>iterator in class java.util.AbstractCollection<java.lang.Character>public int size()
size in interface java.util.Collection<java.lang.Character>size in interface java.util.Set<java.lang.Character>size in class java.util.AbstractCollection<java.lang.Character>public boolean isEmpty()
isEmpty in interface java.util.Collection<java.lang.Character>isEmpty in interface java.util.Set<java.lang.Character>isEmpty in class java.util.AbstractCollection<java.lang.Character>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<java.lang.Character>contains in interface java.util.Set<java.lang.Character>contains in class java.util.AbstractCollection<java.lang.Character>public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException