- 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 allownullelements 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 voidadd(int index, Object element)booleanadd(Object element)booleanaddAll(int index, Collection<?> c)booleanaddAll(Collection<?> c)booleaninsertSinceRecycled()Returnstrueif any elements where added or set.static RecyclableArrayListnewInstance()Create a new emptyRecyclableArrayListinstancestatic RecyclableArrayListnewInstance(int minCapacity)Create a new emptyRecyclableArrayListinstance with the given capacity.booleanrecycle()Clear and recycle this instance.Objectset(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 emptyRecyclableArrayListinstance
-
newInstance
public static RecyclableArrayList newInstance(int minCapacity)
Create a new emptyRecyclableArrayListinstance 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()
Returnstrueif any elements where added or set. This will be reset oncerecycle()was called.
-
recycle
public boolean recycle()
Clear and recycle this instance.
-
-