Package gnu.trove.decorator

# Class TIntListDecorator

java.lang.Object
java.util.AbstractCollection<Integer>
java.util.AbstractList<Integer>
gnu.trove.decorator.TIntListDecorator

All Implemented Interfaces:
  `Externalizable`, `Serializable`, `Cloneable`, `Iterable<Integer>`, `Collection<Integer>`, `List<Integer>`, `SequencedCollection<Integer>`

public class TIntListDecorator extends AbstractList<Integer> implements List<Integer>, Externalizable, Cloneable
Wrapper class to make a TIntList conform to the `java.util.List` API. This class simply decorates an underlying TIntList 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 TIntList`
`list`
the wrapped primitive list

### Fields inherited from class java.util.AbstractList

`modCount`

## Constructor Summary

Constructors
Constructor
Description
`TIntListDecorator()`
FOR EXTERNALIZATION ONLY!!
`TIntListDecorator(TIntList list)`
Creates a wrapper that decorates the specified primitive map.

## Method Summary

Modifier and Type
Method
Description
`void`
`add(int index, Integer value)`
`Integer`
`get(int index)`
`TIntList`
`getList()`
Returns a reference to the list wrapped by this decorator.
`void`
`readExternal(ObjectInput in)`
`Integer`
`remove(int index)`
`Integer`
`set(int index, Integer value)`
`int`
`size()`
`void`
`writeExternal(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.Collection

`parallelStream, removeIf, stream, toArray`

### Methods inherited from interface java.lang.Iterable

`forEach`

### Methods inherited from interface java.util.List

`add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, subList, toArray, toArray`

## Field Details

### list

protected TIntList list
the wrapped primitive list

## Constructor Details

### TIntListDecorator

public TIntListDecorator()
FOR EXTERNALIZATION ONLY!!

### TIntListDecorator

public TIntListDecorator(TIntList list)
Creates a wrapper that decorates the specified primitive map.

Parameters:
  `list` - the `TIntList` to wrap.

## Method Details

### getList

public TIntList getList()
Returns a reference to the list wrapped by this decorator.

Returns:
  the wrapped `TIntList` instance.

### size

public int size()

Specified by:
  `size` in interface `Collection<Integer>`
Specified by:
  `size` in interface `List<Integer>`
Specified by:
  `size` in class `AbstractCollection<Integer>`

### get

public Integer get(int index)

Specified by:
  `get` in interface `List<Integer>`
Specified by:
  `get` in class `AbstractList<Integer>`

### set

public Integer set(int index, Integer value)

Specified by:
  `set` in interface `List<Integer>`
Overrides:
  `set` in class `AbstractList<Integer>`

### add

public void add(int index, Integer value)

Specified by:
  `add` in interface `List<Integer>`
Overrides:
  `add` in class `AbstractList<Integer>`

### remove

public Integer remove(int index)

Specified by:
  `remove` in interface `List<Integer>`
Overrides:
  `remove` in class `AbstractList<Integer>`

### readExternal

public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

### writeExternal

public void writeExternal(ObjectOutput out) throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`