Top Description Inners Fields Constructors Methods
io.netty.handler.codec

pack-priv final Class CodecOutputList

extends AbstractList<Object>
implements RandomAccess
Class Inheritance
All Implemented Interfaces
java.util.RandomAccess
Imports
io.netty.util.concurrent.FastThreadLocal, io.netty.util.internal.MathUtil, java.util.AbstractList, .RandomAccess

Special AbstractList implementation which is used within our codec base classes.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface
private static class

Field Summary

Modifier and TypeField and Description
private Object[]
private static final FastThreadLocal<CodecOutputList.CodecOutputLists>
private boolean
private static final CodecOutputList.CodecOutputListRecycler
private final CodecOutputList.CodecOutputListRecycler
private int
Inherited from java.util.AbstractList:
modCount

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
add(Object
element to be appended to this list
element
)

Overrides java.util.AbstractList.add.

Implements java.util.List.add, java.util.Collection.add.

Appends the specified element to the end of this list (optional operation).
public void
add(int
index at which the specified element is to be inserted
index
,
Object
element to be inserted
element
)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).
private void
checkIndex(int index)

public void
clear()

Overrides java.util.AbstractList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Removes all of the elements from this list (optional operation).
private void
public Object
get(int
index of the element to return
index
)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Returns the element at the specified position in this list.
pack-priv Object
getUnsafe(int index)

Returns the element on the given index.

private void
insert(int index, Object element)

pack-priv boolean
insertSinceRecycled()

Returns true if any elements where added or set.

pack-priv static CodecOutputList
pack-priv void
recycle()

Recycle the array which will clear it and null out all entries in the internal storage.

public Object
remove(int
the index of the element to be removed
index
)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).
public Object
set(int
index of the element to replace
index
,
Object
element to be stored at the specified position
element
)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).
public int
size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Returns the number of elements in this list.
Inherited from java.util.AbstractList:
addAllequalshashCodeindexOfiteratorlastIndexOflistIteratorlistIteratorremoveRangesubList

Field Detail

arrayback to summary
private Object[] array
CODEC_OUTPUT_LISTS_POOLback to summary
private static final FastThreadLocal<CodecOutputList.CodecOutputLists> CODEC_OUTPUT_LISTS_POOL
insertSinceRecycledback to summary
private boolean insertSinceRecycled
NOOP_RECYCLERback to summary
private static final CodecOutputList.CodecOutputListRecycler NOOP_RECYCLER
recyclerback to summary
private final CodecOutputList.CodecOutputListRecycler recycler
sizeback to summary
private int size

Constructor Detail

CodecOutputListback to summary
private CodecOutputList(CodecOutputList.CodecOutputListRecycler recycler, int size)

Method Detail

addback to summary
public boolean add(Object element)

Overrides java.util.AbstractList.add.

Implements java.util.List.add, java.util.Collection.add.

Doc from java.util.AbstractList.add.

Appends the specified element to the end of this list (optional operation).

Lists that support this operation may place limitations on what elements may be added to this list. In particular, some lists will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. List classes should clearly specify in their documentation any restrictions on what elements may be added.

Parameters
element:Object

element to be appended to this list

Returns:boolean

true (as specified by Collection#add)

Annotations
@Override
addback to summary
public void add(int index, Object element)

Overrides java.util.AbstractList.add.

Implements java.util.List.add.

Doc from java.util.AbstractList.add.

Inserts the specified element at the specified position in this list (optional operation). Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).

Parameters
index:int

Doc from java.util.List.add.

index at which the specified element is to be inserted

element:Object

Doc from java.util.List.add.

element to be inserted

Annotations
@Override
checkIndexback to summary
private void checkIndex(int index)
clearback to summary
public void clear()

Overrides java.util.AbstractList.clear.

Implements java.util.List.clear, java.util.Collection.clear.

Doc from java.util.AbstractList.clear.

Removes all of the elements from this list (optional operation). The list will be empty after this call returns.

Annotations
@Override
expandArrayback to summary
private void expandArray()
getback to summary
public Object get(int index)

Implements abstract java.util.AbstractList.get.

Implements java.util.List.get.

Doc from java.util.AbstractList.get.

Returns the element at the specified position in this list.

Parameters
index:int

Doc from java.util.List.get.

index of the element to return

Returns:Object

Doc from java.util.List.get.

the element at the specified position in this list

Annotations
@Override
getUnsafeback to summary
pack-priv Object getUnsafe(int index)

Returns the element on the given index. This operation will not do any range-checks and so is considered unsafe.

insertback to summary
private void insert(int index, Object element)
insertSinceRecycledback to summary
pack-priv boolean insertSinceRecycled()

Returns true if any elements where added or set. This will be reset once recycle() was called.

newInstanceback to summary
pack-priv static CodecOutputList newInstance()
recycleback to summary
pack-priv void recycle()

Recycle the array which will clear it and null out all entries in the internal storage.

removeback to summary
public Object remove(int index)

Overrides java.util.AbstractList.remove.

Implements java.util.List.remove.

Doc from java.util.AbstractList.remove.

Removes the element at the specified position in this list (optional operation). Shifts any subsequent elements to the left (subtracts one from their indices). Returns the element that was removed from the list.

Parameters
index:int

Doc from java.util.List.remove.

the index of the element to be removed

Returns:Object

Doc from java.util.List.remove.

the element previously at the specified position

Annotations
@Override
setback to summary
public Object set(int index, Object element)

Overrides java.util.AbstractList.set.

Implements java.util.List.set.

Doc from java.util.AbstractList.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

Parameters
index:int

Doc from java.util.List.set.

index of the element to replace

element:Object

Doc from java.util.List.set.

element to be stored at the specified position

Returns:Object

Doc from java.util.List.set.

the element previously at the specified position

Annotations
@Override
sizeback to summary
public int size()

Implements abstract java.util.AbstractCollection.size.

Implements java.util.List.size, java.util.Collection.size.

Doc from java.util.List.size.

Returns the number of elements in this list. If this list contains more than Integer.MAX_VALUE elements, returns Integer.MAX_VALUE.

Returns:int

the number of elements in this list

Annotations
@Override
io.netty.handler.codec back to summary

private Interface CodecOutputList.CodecOutputListRecycler

Known Direct Implementers
io.netty.handler.codec.CodecOutputList.CodecOutputLists

Method Summary

Modifier and TypeMethod and Description
public void
recycle(CodecOutputList codecOutputList)

Method Detail

recycleback to summary
public void recycle(CodecOutputList codecOutputList)
io.netty.handler.codec back to summary

private final Class CodecOutputList.CodecOutputLists

extends Object
implements CodecOutputListRecycler
Class Inheritance
All Implemented Interfaces
io.netty.handler.codec.CodecOutputList.CodecOutputListRecycler

Field Summary

Modifier and TypeField and Description
private int
private int
private final CodecOutputList[]
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
CodecOutputLists(int numElements)

Method Summary

Modifier and TypeMethod and Description
public CodecOutputList
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

countback to summary
private int count
currentIdxback to summary
private int currentIdx
elementsback to summary
private final CodecOutputList[] elements
maskback to summary
private final int mask

Constructor Detail

CodecOutputListsback to summary
pack-priv CodecOutputLists(int numElements)

Method Detail

getOrCreateback to summary
public CodecOutputList getOrCreate()
recycleback to summary
public void recycle(CodecOutputList codecOutputList)

Implements io.netty.handler.codec.CodecOutputList.CodecOutputListRecycler.recycle.

Annotations
@Override