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:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable
,java.util.Collection
,java.util.List
,java.util.RandomAccess
public class EmptyArrayList extends java.util.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 EmptyArrayList
INSTANCE
-
Constructor Summary
Constructors Modifier Constructor Description private
EmptyArrayList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, java.lang.Object element)
boolean
add(java.lang.Object o)
boolean
addAll(int index, java.util.Collection c)
boolean
addAll(java.util.Collection c)
void
clear()
void
ensureCapacity(int minCapacity)
java.lang.Object
remove(int index)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection c)
protected void
removeRange(int fromIndex, int toIndex)
boolean
retainAll(java.util.Collection c)
java.lang.Object
set(int index, java.lang.Object element)
void
trimToSize()
-
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
-
-
-
-
Field Detail
-
INSTANCE
public static final EmptyArrayList INSTANCE
-
-
Method Detail
-
add
public void add(int index, java.lang.Object element)
- Specified by:
add
in interfacejava.util.List
- Overrides:
add
in classjava.util.ArrayList
-
add
public boolean add(java.lang.Object o)
- Specified by:
add
in interfacejava.util.Collection
- Specified by:
add
in interfacejava.util.List
- Overrides:
add
in classjava.util.ArrayList
-
addAll
public boolean addAll(java.util.Collection c)
- Specified by:
addAll
in interfacejava.util.Collection
- Specified by:
addAll
in interfacejava.util.List
- Overrides:
addAll
in classjava.util.ArrayList
-
addAll
public boolean addAll(int index, java.util.Collection c)
- Specified by:
addAll
in interfacejava.util.List
- Overrides:
addAll
in classjava.util.ArrayList
-
ensureCapacity
public void ensureCapacity(int minCapacity)
- Overrides:
ensureCapacity
in classjava.util.ArrayList
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection
- Specified by:
clear
in interfacejava.util.List
- Overrides:
clear
in classjava.util.ArrayList
-
remove
public java.lang.Object remove(int index)
- Specified by:
remove
in interfacejava.util.List
- Overrides:
remove
in classjava.util.ArrayList
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection
- Specified by:
remove
in interfacejava.util.List
- Overrides:
remove
in classjava.util.ArrayList
-
removeRange
protected void removeRange(int fromIndex, int toIndex)
- Overrides:
removeRange
in classjava.util.ArrayList
-
set
public java.lang.Object set(int index, java.lang.Object element)
- Specified by:
set
in interfacejava.util.List
- Overrides:
set
in classjava.util.ArrayList
-
trimToSize
public void trimToSize()
- Overrides:
trimToSize
in classjava.util.ArrayList
-
removeAll
public boolean removeAll(java.util.Collection c)
- Specified by:
removeAll
in interfacejava.util.Collection
- Specified by:
removeAll
in interfacejava.util.List
- Overrides:
removeAll
in classjava.util.ArrayList
-
retainAll
public boolean retainAll(java.util.Collection c)
- Specified by:
retainAll
in interfacejava.util.Collection
- Specified by:
retainAll
in interfacejava.util.List
- Overrides:
retainAll
in classjava.util.ArrayList
-
-