Package org.jibx.binding.model
Class EmptyArrayList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList
-
- org.jibx.binding.model.EmptyArrayList
-
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,List,RandomAccess
public class EmptyArrayList extends ArrayList
Unmodifiable empty array list. This defines a singleton instance of itself, which can then be used whereever an empty list is convenient. This class is required to support methods which return instances of java.util.ArrayList in order to guarantee random access to the returned list in constant time as part of the method contract. java.util.Collection.EMPTY_LIST is not an instance of java.util.ArrayList, so it cannot be used.- Author:
- Dennis M. Sosnoski
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static EmptyArrayListINSTANCE-
Fields inherited from class java.util.AbstractList
modCount
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int index, Object element)booleanadd(Object o)booleanaddAll(int index, Collection c)booleanaddAll(Collection c)voidclear()voidensureCapacity(int minCapacity)Objectremove(int index)booleanremove(Object o)booleanremoveAll(Collection c)protected voidremoveRange(int fromIndex, int toIndex)booleanretainAll(Collection c)Objectset(int index, Object element)voidtrimToSize()-
Methods inherited from class java.util.ArrayList
clone, contains, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeIf, replaceAll, size, sort, spliterator, subList, toArray, toArray
-
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
-
-
-
-
Field Detail
-
INSTANCE
public static final EmptyArrayList INSTANCE
-
-
Method Detail
-
add
public void add(int index, Object element)
-
add
public boolean add(Object o)
-
addAll
public boolean addAll(Collection c)
-
addAll
public boolean addAll(int index, Collection c)
-
ensureCapacity
public void ensureCapacity(int minCapacity)
- Overrides:
ensureCapacityin classArrayList
-
clear
public void clear()
-
remove
public Object remove(int index)
-
remove
public boolean remove(Object o)
-
removeRange
protected void removeRange(int fromIndex, int toIndex)- Overrides:
removeRangein classArrayList
-
trimToSize
public void trimToSize()
- Overrides:
trimToSizein classArrayList
-
removeAll
public boolean removeAll(Collection c)
-
retainAll
public boolean retainAll(Collection c)
-
-