Package gnu.trove.decorator

# Class TByteListDecorator

java.lang.Object
java.util.AbstractCollection<Byte>
java.util.AbstractList<Byte>
gnu.trove.decorator.TByteListDecorator

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

public class TByteListDecorator extends AbstractList<Byte> implements List<Byte>, Externalizable, Cloneable
Wrapper 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

## Field Summary

Fields
Modifier and Type
Field
Description
`protected TByteList`
`list`
the wrapped primitive list

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

`modCount`

## Constructor Summary

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

## Method Summary

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

## Constructor Details

### 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 Details

### 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:
  `size` in interface `Collection<Byte>`
Specified by:
  `size` in interface `List<Byte>`
Specified by:
  `size` in class `AbstractCollection<Byte>`

### get

public Byte get(int index)

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

### set

public Byte set(int index, Byte value)

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

### add

public void add(int index, Byte value)

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

### remove

public Byte remove(int index)

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

### 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`