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 TypeMethodDescriptionvoid
boolean
boolean
addAll
(int index, Collection c) boolean
addAll
(Collection c) void
clear()
void
ensureCapacity
(int minCapacity) remove
(int index) boolean
boolean
protected void
removeRange
(int fromIndex, int toIndex) boolean
void
Methods 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, 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, reversed
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
EmptyArrayList
private EmptyArrayList()
-
-
Method Details
-
add
-
add
-
addAll
-
addAll
-
ensureCapacity
public void ensureCapacity(int minCapacity) - Overrides:
ensureCapacity
in classArrayList
-
clear
public void clear() -
remove
-
remove
-
removeRange
protected void removeRange(int fromIndex, int toIndex) - Overrides:
removeRange
in classArrayList
-
set
-
trimToSize
public void trimToSize()- Overrides:
trimToSize
in classArrayList
-
removeAll
-
retainAll
-