Package gnu.trove.decorator
Class TShortListDecorator
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<java.lang.Short>
-
- gnu.trove.decorator.TShortListDecorator
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<java.lang.Short>,java.util.Collection<java.lang.Short>,java.util.List<java.lang.Short>
public class TShortListDecorator extends java.util.AbstractList<java.lang.Short> implements java.util.List<java.lang.Short>, java.io.Externalizable, java.lang.CloneableWrapper class to make a TShortList conform to the java.util.List API. This class simply decorates an underlying TShortList 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
Fields Modifier and Type Field Description protected TShortListlistthe wrapped primitive list
-
Constructor Summary
Constructors Constructor Description TShortListDecorator()FOR EXTERNALIZATION ONLY!!TShortListDecorator(TShortList 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.Short value)java.lang.Shortget(int index)TShortListgetList()Returns a reference to the list wrapped by this decorator.voidreadExternal(java.io.ObjectInput in)java.lang.Shortremove(int index)java.lang.Shortset(int index, java.lang.Short 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 TShortList list
the wrapped primitive list
-
-
Constructor Detail
-
TShortListDecorator
public TShortListDecorator()
FOR EXTERNALIZATION ONLY!!
-
TShortListDecorator
public TShortListDecorator(TShortList list)
Creates a wrapper that decorates the specified primitive map.- Parameters:
list- the TShortList to wrap.
-
-
Method Detail
-
getList
public TShortList getList()
Returns a reference to the list wrapped by this decorator.- Returns:
- the wrapped TShortList instance.
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<java.lang.Short>- Specified by:
sizein interfacejava.util.List<java.lang.Short>- Specified by:
sizein classjava.util.AbstractCollection<java.lang.Short>
-
get
public java.lang.Short get(int index)
- Specified by:
getin interfacejava.util.List<java.lang.Short>- Specified by:
getin classjava.util.AbstractList<java.lang.Short>
-
set
public java.lang.Short set(int index, java.lang.Short value)- Specified by:
setin interfacejava.util.List<java.lang.Short>- Overrides:
setin classjava.util.AbstractList<java.lang.Short>
-
add
public void add(int index, java.lang.Short value)- Specified by:
addin interfacejava.util.List<java.lang.Short>- Overrides:
addin classjava.util.AbstractList<java.lang.Short>
-
remove
public java.lang.Short remove(int index)
- Specified by:
removein interfacejava.util.List<java.lang.Short>- Overrides:
removein classjava.util.AbstractList<java.lang.Short>
-
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
-
-