- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<Object>
-
- io.netty5.util.internal.RecyclableArrayList
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Object>
,Collection<Object>
,List<Object>
,RandomAccess
public final class RecyclableArrayList extends ArrayList<Object>
A simple list which is recyclable. This implementation does not allownull
elements to be added.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, Object element)
boolean
add(Object element)
boolean
addAll(int index, Collection<?> c)
boolean
addAll(Collection<?> c)
boolean
insertSinceRecycled()
Returnstrue
if any elements where added or set.static RecyclableArrayList
newInstance()
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.Object
set(int index, Object element)
-
Methods inherited from class java.util.ArrayList
clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, 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
-
-
-
-
Method Detail
-
newInstance
public static RecyclableArrayList newInstance()
Create a new emptyRecyclableArrayList
instance
-
newInstance
public static RecyclableArrayList newInstance(int minCapacity)
Create a new emptyRecyclableArrayList
instance with the given capacity.
-
addAll
public boolean addAll(Collection<?> c)
-
addAll
public boolean addAll(int index, Collection<?> c)
-
add
public boolean add(Object element)
-
add
public void add(int index, Object element)
-
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.
-
-