Class CodecOutputList
java.lang.Object
java.util.AbstractCollection<java.lang.Object>
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
Special
AbstractList implementation which is used within our codec base classes.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate java.lang.Object[]private static final FastThreadLocal<CodecOutputList.CodecOutputLists> private booleanprivate intprivate static final CodecOutputList.CodecOutputListRecyclerprivate final CodecOutputList.CodecOutputListRecyclerprivate intFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCodecOutputList(CodecOutputList.CodecOutputListRecycler recycler, int size) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, java.lang.Object element) booleanadd(java.lang.Object element) private voidcheckIndex(int index) voidclear()private voidjava.lang.Objectget(int index) (package private) java.lang.ObjectgetUnsafe(int index) Returns the element on the given index.private voidinsert(int index, java.lang.Object element) (package private) booleanReturnstrueif any elements where added or set.(package private) static CodecOutputList(package private) voidrecycle()Recycle the array which will clear it and null out all entries in the internal storage.java.lang.Objectremove(int index) java.lang.Objectset(int index, java.lang.Object element) intsize()Methods inherited from class java.util.AbstractList
addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, streamMethods inherited from interface java.lang.Iterable
forEachMethods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
NOOP_RECYCLER
-
CODEC_OUTPUT_LISTS_POOL
-
recycler
-
size
private int size -
maxSeenSize
private int maxSeenSize -
array
private java.lang.Object[] array -
insertSinceRecycled
private boolean insertSinceRecycled
-
-
Constructor Details
-
CodecOutputList
-
-
Method Details
-
newInstance
-
get
public java.lang.Object get(int index) - Specified by:
getin interfacejava.util.List<java.lang.Object>- Specified by:
getin classjava.util.AbstractList<java.lang.Object>
-
size
public int size()- Specified by:
sizein interfacejava.util.Collection<java.lang.Object>- Specified by:
sizein interfacejava.util.List<java.lang.Object>- Specified by:
sizein classjava.util.AbstractCollection<java.lang.Object>
-
add
public boolean add(java.lang.Object element) - Specified by:
addin interfacejava.util.Collection<java.lang.Object>- Specified by:
addin interfacejava.util.List<java.lang.Object>- Overrides:
addin classjava.util.AbstractList<java.lang.Object>
-
set
public java.lang.Object set(int index, java.lang.Object element) - Specified by:
setin interfacejava.util.List<java.lang.Object>- Overrides:
setin classjava.util.AbstractList<java.lang.Object>
-
add
public void add(int index, java.lang.Object element) - Specified by:
addin interfacejava.util.List<java.lang.Object>- Overrides:
addin classjava.util.AbstractList<java.lang.Object>
-
remove
public java.lang.Object remove(int index) - Specified by:
removein interfacejava.util.List<java.lang.Object>- Overrides:
removein classjava.util.AbstractList<java.lang.Object>
-
clear
public void clear()- Specified by:
clearin interfacejava.util.Collection<java.lang.Object>- Specified by:
clearin interfacejava.util.List<java.lang.Object>- Overrides:
clearin classjava.util.AbstractList<java.lang.Object>
-
insertSinceRecycled
boolean insertSinceRecycled()Returnstrueif 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()
-