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 interface
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Object[]
private static final FastThreadLocal
<CodecOutputList.CodecOutputLists> private boolean
private static final CodecOutputList.CodecOutputListRecycler
private final CodecOutputList.CodecOutputListRecycler
private int
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
CodecOutputList
(CodecOutputList.CodecOutputListRecycler recycler, int size) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
private void
checkIndex
(int index) void
clear()
private void
get
(int index) (package private) Object
getUnsafe
(int index) Returns the element on the given index.private void
(package private) boolean
Returnstrue
if any elements where added or set.(package private) static CodecOutputList
(package private) void
recycle()
Recycle the array which will clear it and null out all entries in the internal storage.remove
(int index) 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
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.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 -
array
-
insertSinceRecycled
private boolean insertSinceRecycled
-
-
Constructor Details
-
CodecOutputList
-
-
Method Details
-
newInstance
-
get
-
size
public int size()- Specified by:
size
in interfaceCollection<Object>
- Specified by:
size
in interfaceList<Object>
- Specified by:
size
in classAbstractCollection<Object>
-
add
- Specified by:
add
in interfaceCollection<Object>
- Specified by:
add
in interfaceList<Object>
- Overrides:
add
in classAbstractList<Object>
-
set
-
add
-
remove
-
clear
public void clear()- Specified by:
clear
in interfaceCollection<Object>
- Specified by:
clear
in interfaceList<Object>
- Overrides:
clear
in classAbstractList<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
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()
-