Package gnu.trove.decorator
Class TCharListDecorator
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<java.lang.Character>
-
- gnu.trove.decorator.TCharListDecorator
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<java.lang.Character>,java.util.Collection<java.lang.Character>,java.util.List<java.lang.Character>
public class TCharListDecorator extends java.util.AbstractList<java.lang.Character> implements java.util.List<java.lang.Character>, java.io.Externalizable, java.lang.CloneableWrapper class to make a TCharList conform to the java.util.List API. This class simply decorates an underlying TCharList 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.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TCharListDecorator()FOR EXTERNALIZATION ONLY!!TCharListDecorator(TCharList list)Creates a wrapper that decorates the specified primitive map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, java.lang.Character value)java.lang.Characterget(int index)TCharListgetList()Returns a reference to the list wrapped by this decorator.voidreadExternal(java.io.ObjectInput in)java.lang.Characterremove(int index)java.lang.Characterset(int index, java.lang.Character value)intsize()voidwriteExternal(java.io.ObjectOutput out)-
Methods inherited from class java.util.AbstractList
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Field Detail
-
list
protected TCharList list
the wrapped primitive list
-
-
Constructor Detail
-
TCharListDecorator
public TCharListDecorator()
FOR EXTERNALIZATION ONLY!!
-
TCharListDecorator
public TCharListDecorator(TCharList list)
Creates a wrapper that decorates the specified primitive map.- Parameters:
list- the TCharList to wrap.
-
-
Method Detail
-
getList
public TCharList getList()
Returns a reference to the list wrapped by this decorator.- Returns:
- the wrapped TCharList instance.
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<java.lang.Character>- Specified by:
sizein interfacejava.util.List<java.lang.Character>- Specified by:
sizein classjava.util.AbstractCollection<java.lang.Character>
-
get
public java.lang.Character get(int index)
- Specified by:
getin interfacejava.util.List<java.lang.Character>- Specified by:
getin classjava.util.AbstractList<java.lang.Character>
-
set
public java.lang.Character set(int index, java.lang.Character value)- Specified by:
setin interfacejava.util.List<java.lang.Character>- Overrides:
setin classjava.util.AbstractList<java.lang.Character>
-
add
public void add(int index, java.lang.Character value)- Specified by:
addin interfacejava.util.List<java.lang.Character>- Overrides:
addin classjava.util.AbstractList<java.lang.Character>
-
remove
public java.lang.Character remove(int index)
- Specified by:
removein interfacejava.util.List<java.lang.Character>- Overrides:
removein classjava.util.AbstractList<java.lang.Character>
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOExceptionjava.lang.ClassNotFoundException
-
writeExternal
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
-