Package io.netty.handler.codec
Class CodecOutputList
- All Implemented Interfaces:
Iterable<Object>,Collection<Object>,List<Object>,RandomAccess,SequencedCollection<Object>
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 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 TypeMethodDescriptionvoidbooleanprivate voidcheckIndex(int index) voidclear()private voidget(int index) (package private) ObjectgetUnsafe(int index) Returns the element on the given index.private void(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.remove(int index) 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, stream, toArrayMethods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, isEmpty, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray, toArray
-
Field Details
-
NOOP_RECYCLER
-
CODEC_OUTPUT_LISTS_POOL
-
recycler
-
size
private int size -
maxSeenSize
private int maxSeenSize -
array
-
insertSinceRecycled
private boolean insertSinceRecycled
-
-
Constructor Details
-
CodecOutputList
-
-
Method Details
-
newInstance
-
get
-
size
public int size()- Specified by:
sizein interfaceCollection<Object>- Specified by:
sizein interfaceList<Object>- Specified by:
sizein classAbstractCollection<Object>
-
add
- Specified by:
addin interfaceCollection<Object>- Specified by:
addin interfaceList<Object>- Overrides:
addin classAbstractList<Object>
-
set
-
add
-
remove
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Object>- Specified by:
clearin interfaceList<Object>- Overrides:
clearin classAbstractList<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
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
-
expandArray
private void expandArray()
-