Package org.jibx.binding.model
Class EmptyArrayList
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
java.util.ArrayList
org.jibx.binding.model.EmptyArrayList
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,List,RandomAccess,SequencedCollection
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:
-
Field Summary
FieldsFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection c) booleanaddAll(Collection c) voidclear()voidensureCapacity(int minCapacity) remove(int index) booleanbooleanprotected voidremoveRange(int fromIndex, int toIndex) booleanvoidMethods inherited from class java.util.ArrayList
addFirst, addLast, clone, contains, equals, forEach, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, removeFirst, removeIf, removeLast, replaceAll, size, sort, spliterator, subList, toArray, toArrayMethods inherited from class java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
EmptyArrayList
private EmptyArrayList()
-
-
Method Details
-
add
-
add
-
addAll
-
addAll
-
ensureCapacity
public void ensureCapacity(int minCapacity) - Overrides:
ensureCapacityin classArrayList
-
clear
public void clear() -
remove
-
remove
-
removeRange
protected void removeRange(int fromIndex, int toIndex) - Overrides:
removeRangein classArrayList
-
set
-
trimToSize
public void trimToSize()- Overrides:
trimToSizein classArrayList
-
removeAll
-
retainAll
-