Package io.netty.handler.codec
Class CodecOutputList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<java.lang.Object>
-
- io.netty.handler.codec.CodecOutputList
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.Object>
,java.util.Collection<java.lang.Object>
,java.util.List<java.lang.Object>
,java.util.RandomAccess
final class CodecOutputList extends java.util.AbstractList<java.lang.Object> implements java.util.RandomAccess
SpecialAbstractList
implementation which is used within our codec base classes.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static interface
CodecOutputList.CodecOutputListRecycler
private static class
CodecOutputList.CodecOutputLists
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Object[]
array
private static FastThreadLocal<CodecOutputList.CodecOutputLists>
CODEC_OUTPUT_LISTS_POOL
private boolean
insertSinceRecycled
private static CodecOutputList.CodecOutputListRecycler
NOOP_RECYCLER
private CodecOutputList.CodecOutputListRecycler
recycler
private int
size
-
Constructor Summary
Constructors Modifier Constructor Description private
CodecOutputList(CodecOutputList.CodecOutputListRecycler recycler, int size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, java.lang.Object element)
boolean
add(java.lang.Object element)
private void
checkIndex(int index)
void
clear()
private void
expandArray()
java.lang.Object
get(int index)
(package private) java.lang.Object
getUnsafe(int index)
Returns the element on the given index.private void
insert(int index, java.lang.Object element)
(package private) boolean
insertSinceRecycled()
Returnstrue
if any elements where added or set.(package private) static CodecOutputList
newInstance()
(package private) void
recycle()
Recycle the array which will clear it and null out all entries in the internal storage.java.lang.Object
remove(int index)
java.lang.Object
set(int index, java.lang.Object element)
int
size()
-
Methods inherited from class java.util.AbstractList
addAll, 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
-
NOOP_RECYCLER
private static final CodecOutputList.CodecOutputListRecycler NOOP_RECYCLER
-
CODEC_OUTPUT_LISTS_POOL
private static final FastThreadLocal<CodecOutputList.CodecOutputLists> CODEC_OUTPUT_LISTS_POOL
-
recycler
private final CodecOutputList.CodecOutputListRecycler recycler
-
size
private int size
-
array
private java.lang.Object[] array
-
insertSinceRecycled
private boolean insertSinceRecycled
-
-
Constructor Detail
-
CodecOutputList
private CodecOutputList(CodecOutputList.CodecOutputListRecycler recycler, int size)
-
-
Method Detail
-
newInstance
static CodecOutputList newInstance()
-
get
public java.lang.Object get(int index)
- Specified by:
get
in interfacejava.util.List<java.lang.Object>
- Specified by:
get
in classjava.util.AbstractList<java.lang.Object>
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection<java.lang.Object>
- Specified by:
size
in interfacejava.util.List<java.lang.Object>
- Specified by:
size
in classjava.util.AbstractCollection<java.lang.Object>
-
add
public boolean add(java.lang.Object element)
- Specified by:
add
in interfacejava.util.Collection<java.lang.Object>
- Specified by:
add
in interfacejava.util.List<java.lang.Object>
- Overrides:
add
in classjava.util.AbstractList<java.lang.Object>
-
set
public java.lang.Object set(int index, java.lang.Object element)
- Specified by:
set
in interfacejava.util.List<java.lang.Object>
- Overrides:
set
in classjava.util.AbstractList<java.lang.Object>
-
add
public void add(int index, java.lang.Object element)
- Specified by:
add
in interfacejava.util.List<java.lang.Object>
- Overrides:
add
in classjava.util.AbstractList<java.lang.Object>
-
remove
public java.lang.Object remove(int index)
- Specified by:
remove
in interfacejava.util.List<java.lang.Object>
- Overrides:
remove
in classjava.util.AbstractList<java.lang.Object>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<java.lang.Object>
- Specified by:
clear
in interfacejava.util.List<java.lang.Object>
- Overrides:
clear
in classjava.util.AbstractList<java.lang.Object>
-
insertSinceRecycled
boolean insertSinceRecycled()
Returnstrue
if any elements where added or set. This will be reset oncerecycle()
was called.
-
recycle
void recycle()
Recycle the array which will clear it and null out all entries in the internal storage.
-
getUnsafe
java.lang.Object getUnsafe(int index)
Returns the element on the given index. This operation will not do any range-checks and so is considered unsafe.
-
checkIndex
private void checkIndex(int index)
-
insert
private void insert(int index, java.lang.Object element)
-
expandArray
private void expandArray()
-
-