Package 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.CloneableWrapper 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
-
-
Constructor Summary
Constructors Constructor Description TByteListDecorator()FOR EXTERNALIZATION ONLY!!TByteListDecorator(TByteList 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.Byte value)java.lang.Byteget(int index)TByteListgetList()Returns a reference to the list wrapped by this decorator.voidreadExternal(java.io.ObjectInput in)java.lang.Byteremove(int index)java.lang.Byteset(int index, java.lang.Byte 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 TByteList list
the wrapped primitive list
-
-
Constructor Detail
-
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.
-
-
Method Detail
-
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:
sizein interfacejava.util.Collection<java.lang.Byte>- Specified by:
sizein interfacejava.util.List<java.lang.Byte>- Specified by:
sizein classjava.util.AbstractCollection<java.lang.Byte>
-
get
public java.lang.Byte get(int index)
- Specified by:
getin interfacejava.util.List<java.lang.Byte>- Specified by:
getin classjava.util.AbstractList<java.lang.Byte>
-
set
public java.lang.Byte set(int index, java.lang.Byte value)- Specified by:
setin interfacejava.util.List<java.lang.Byte>- Overrides:
setin classjava.util.AbstractList<java.lang.Byte>
-
add
public void add(int index, java.lang.Byte value)- Specified by:
addin interfacejava.util.List<java.lang.Byte>- Overrides:
addin classjava.util.AbstractList<java.lang.Byte>
-
remove
public java.lang.Byte remove(int index)
- Specified by:
removein interfacejava.util.List<java.lang.Byte>- Overrides:
removein classjava.util.AbstractList<java.lang.Byte>
-
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
-
-