Package gnu.trove.decorator
Class TLongListDecorator
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<java.lang.Long>
-
- gnu.trove.decorator.TLongListDecorator
-
- All Implemented Interfaces:
java.io.Externalizable,java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<java.lang.Long>,java.util.Collection<java.lang.Long>,java.util.List<java.lang.Long>
public class TLongListDecorator extends java.util.AbstractList<java.lang.Long> implements java.util.List<java.lang.Long>, java.io.Externalizable, java.lang.CloneableWrapper class to make a TLongList conform to the java.util.List API. This class simply decorates an underlying TLongList 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 TLongListDecorator()FOR EXTERNALIZATION ONLY!!TLongListDecorator(TLongList 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.Long value)java.lang.Longget(int index)TLongListgetList()Returns a reference to the list wrapped by this decorator.voidreadExternal(java.io.ObjectInput in)java.lang.Longremove(int index)java.lang.Longset(int index, java.lang.Long 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 TLongList list
the wrapped primitive list
-
-
Constructor Detail
-
TLongListDecorator
public TLongListDecorator()
FOR EXTERNALIZATION ONLY!!
-
TLongListDecorator
public TLongListDecorator(TLongList list)
Creates a wrapper that decorates the specified primitive map.- Parameters:
list- the TLongList to wrap.
-
-
Method Detail
-
getList
public TLongList getList()
Returns a reference to the list wrapped by this decorator.- Returns:
- the wrapped TLongList instance.
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection<java.lang.Long>- Specified by:
sizein interfacejava.util.List<java.lang.Long>- Specified by:
sizein classjava.util.AbstractCollection<java.lang.Long>
-
get
public java.lang.Long get(int index)
- Specified by:
getin interfacejava.util.List<java.lang.Long>- Specified by:
getin classjava.util.AbstractList<java.lang.Long>
-
set
public java.lang.Long set(int index, java.lang.Long value)- Specified by:
setin interfacejava.util.List<java.lang.Long>- Overrides:
setin classjava.util.AbstractList<java.lang.Long>
-
add
public void add(int index, java.lang.Long value)- Specified by:
addin interfacejava.util.List<java.lang.Long>- Overrides:
addin classjava.util.AbstractList<java.lang.Long>
-
remove
public java.lang.Long remove(int index)
- Specified by:
removein interfacejava.util.List<java.lang.Long>- Overrides:
removein classjava.util.AbstractList<java.lang.Long>
-
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
-
-