Package io.netty.util.internal
Class RecyclableArrayList
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Object>
,Collection<Object>
,List<Object>
,RandomAccess
,SequencedCollection<Object>
A simple list which is recyclable. This implementation does not allow
null
elements to be added.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private final ObjectPool.Handle
<RecyclableArrayList> private boolean
private static final ObjectPool
<RecyclableArrayList> private static final long
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
private
RecyclableArrayList
(ObjectPool.Handle<RecyclableArrayList> handle, int initialCapacity) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection<?> c) boolean
addAll
(Collection<?> c) private static void
checkNullElements
(Collection<?> c) boolean
Returnstrue
if any elements where added or set.static RecyclableArrayList
Create a new emptyRecyclableArrayList
instancestatic RecyclableArrayList
newInstance
(int minCapacity) Create a new emptyRecyclableArrayList
instance with the given capacity.boolean
recycle()
Clear and recycle this instance.Methods inherited from class java.util.ArrayList
addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
DEFAULT_INITIAL_CAPACITY
private static final int DEFAULT_INITIAL_CAPACITY- See Also:
-
RECYCLER
-
insertSinceRecycled
private boolean insertSinceRecycled -
handle
-
-
Constructor Details
-
RecyclableArrayList
-
RecyclableArrayList
-
-
Method Details
-
newInstance
Create a new emptyRecyclableArrayList
instance -
newInstance
Create a new emptyRecyclableArrayList
instance with the given capacity. -
addAll
-
addAll
-
checkNullElements
-
add
-
add
-
set
-
insertSinceRecycled
public boolean insertSinceRecycled()Returnstrue
if any elements where added or set. This will be reset oncerecycle()
was called. -
recycle
public boolean recycle()Clear and recycle this instance.
-