org.jibx.binding.model
Class EmptyArrayList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by 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
static EmptyArrayList INSTANCE
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 void clear()
           
 void ensureCapacity(int minCapacity)
           
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
protected  void removeRange(int fromIndex, int toIndex)
           
 boolean retainAll(Collection c)
           
 Object set(int index, Object element)
           
 void trimToSize()
           
 
Methods inherited from class java.util.ArrayList
clone, contains, get, indexOf, isEmpty, lastIndexOf, size, toArray, toArray
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
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.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, subList
 

Field Detail

INSTANCE

public static final EmptyArrayList INSTANCE
Method Detail

add

public void add(int index,
                Object element)
Specified by:
add in interface List
Overrides:
add in class ArrayList

add

public boolean add(Object o)
Specified by:
add in interface Collection
Specified by:
add in interface List
Overrides:
add in class ArrayList

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List
Overrides:
addAll in class ArrayList

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface List
Overrides:
addAll in class ArrayList

ensureCapacity

public void ensureCapacity(int minCapacity)
Overrides:
ensureCapacity in class ArrayList

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List
Overrides:
clear in class ArrayList

remove

public Object remove(int index)
Specified by:
remove in interface List
Overrides:
remove in class ArrayList

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface List
Overrides:
remove in class ArrayList

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Overrides:
removeRange in class ArrayList

set

public Object set(int index,
                  Object element)
Specified by:
set in interface List
Overrides:
set in class ArrayList

trimToSize

public void trimToSize()
Overrides:
trimToSize in class ArrayList

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List
Overrides:
removeAll in class AbstractCollection

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List
Overrides:
retainAll in class AbstractCollection


Copyright © 2005-2011 jibx.org. All Rights Reserved.