gnu.trove.decorator
Class TByteListDecorator
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<java.lang.Byte>
gnu.trove.decorator.TByteListDecorator
- All Implemented Interfaces:
- java.io.Externalizable, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Byte>, java.util.Collection<java.lang.Byte>, java.util.List<java.lang.Byte>
public class TByteListDecorator
- extends java.util.AbstractList<java.lang.Byte>
- implements java.util.List<java.lang.Byte>, java.io.Externalizable, java.lang.Cloneable
Wrapper class to make a TByteList conform to the java.util.List API.
This class simply decorates an underlying TByteList 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
Field Summary |
protected TByteList |
list
the wrapped primitive list |
Fields inherited from class java.util.AbstractList |
modCount |
Method Summary |
void |
add(int index,
java.lang.Byte value)
|
java.lang.Byte |
get(int index)
|
TByteList |
getList()
Returns a reference to the list wrapped by this decorator. |
void |
readExternal(java.io.ObjectInput in)
|
java.lang.Byte |
remove(int index)
|
java.lang.Byte |
set(int index,
java.lang.Byte value)
|
int |
size()
|
void |
writeExternal(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 |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
add, addAll, addAll, clear, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, retainAll, subList, toArray, toArray |
list
protected TByteList list
- the wrapped primitive list
TByteListDecorator
public TByteListDecorator()
- FOR EXTERNALIZATION ONLY!!
TByteListDecorator
public TByteListDecorator(TByteList list)
- Creates a wrapper that decorates the specified primitive map.
- Parameters:
list
- the TByteList to wrap.
getList
public TByteList getList()
- Returns a reference to the list wrapped by this decorator.
- Returns:
- the wrapped TByteList instance.
size
public int size()
- Specified by:
size
in interface java.util.Collection<java.lang.Byte>
- Specified by:
size
in interface java.util.List<java.lang.Byte>
- Specified by:
size
in class java.util.AbstractCollection<java.lang.Byte>
get
public java.lang.Byte get(int index)
- Specified by:
get
in interface java.util.List<java.lang.Byte>
- Specified by:
get
in class java.util.AbstractList<java.lang.Byte>
set
public java.lang.Byte set(int index,
java.lang.Byte value)
- Specified by:
set
in interface java.util.List<java.lang.Byte>
- Overrides:
set
in class java.util.AbstractList<java.lang.Byte>
add
public void add(int index,
java.lang.Byte value)
- Specified by:
add
in interface java.util.List<java.lang.Byte>
- Overrides:
add
in class java.util.AbstractList<java.lang.Byte>
remove
public java.lang.Byte remove(int index)
- Specified by:
remove
in interface java.util.List<java.lang.Byte>
- Overrides:
remove
in class java.util.AbstractList<java.lang.Byte>
readExternal
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
- Specified by:
readExternal
in interface java.io.Externalizable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
writeExternal
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
- Specified by:
writeExternal
in interface java.io.Externalizable
- Throws:
java.io.IOException