Package gnu.trove.decorator
Class TDoubleListDecorator
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<java.lang.Double>
-
- gnu.trove.decorator.TDoubleListDecorator
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<java.lang.Double>
,java.util.Collection<java.lang.Double>
,java.util.List<java.lang.Double>
public class TDoubleListDecorator extends java.util.AbstractList<java.lang.Double> implements java.util.List<java.lang.Double>, java.io.Externalizable, java.lang.Cloneable
Wrapper class to make a TDoubleList conform to the java.util.List API. This class simply decorates an underlying TDoubleList 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 TDoubleList
list
the wrapped primitive list
-
Constructor Summary
Constructors Constructor Description TDoubleListDecorator()
FOR EXTERNALIZATION ONLY!!TDoubleListDecorator(TDoubleList list)
Creates a wrapper that decorates the specified primitive map.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, java.lang.Double value)
java.lang.Double
get(int index)
TDoubleList
getList()
Returns a reference to the list wrapped by this decorator.void
readExternal(java.io.ObjectInput in)
java.lang.Double
remove(int index)
java.lang.Double
set(int index, java.lang.Double 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
-
-
-
-
Field Detail
-
list
protected TDoubleList list
the wrapped primitive list
-
-
Constructor Detail
-
TDoubleListDecorator
public TDoubleListDecorator()
FOR EXTERNALIZATION ONLY!!
-
TDoubleListDecorator
public TDoubleListDecorator(TDoubleList list)
Creates a wrapper that decorates the specified primitive map.- Parameters:
list
- the TDoubleList to wrap.
-
-
Method Detail
-
getList
public TDoubleList getList()
Returns a reference to the list wrapped by this decorator.- Returns:
- the wrapped TDoubleList instance.
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<java.lang.Double>
- Specified by:
size
in interfacejava.util.List<java.lang.Double>
- Specified by:
size
in classjava.util.AbstractCollection<java.lang.Double>
-
get
public java.lang.Double get(int index)
- Specified by:
get
in interfacejava.util.List<java.lang.Double>
- Specified by:
get
in classjava.util.AbstractList<java.lang.Double>
-
set
public java.lang.Double set(int index, java.lang.Double value)
- Specified by:
set
in interfacejava.util.List<java.lang.Double>
- Overrides:
set
in classjava.util.AbstractList<java.lang.Double>
-
add
public void add(int index, java.lang.Double value)
- Specified by:
add
in interfacejava.util.List<java.lang.Double>
- Overrides:
add
in classjava.util.AbstractList<java.lang.Double>
-
remove
public java.lang.Double remove(int index)
- Specified by:
remove
in interfacejava.util.List<java.lang.Double>
- Overrides:
remove
in classjava.util.AbstractList<java.lang.Double>
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
- Specified by:
readExternal
in interfacejava.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 interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
-