org.jboss.ha.framework.interfaces
Class ImmutableArrayList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.jboss.ha.framework.interfaces.ImmutableArrayList
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess

public class ImmutableArrayList
extends ArrayList

Subclasses ArrayList but throws an UnsupportedOperationException from any method that would change the internal data members. Any iterators that are returned do the same. All other methods are delegated to the ArrayList that is passed to the constructor, so creating an instance of this class does not result in making a copy of the internal element array of the source array list.

Version:
$Revision: 1.1 $
Author:
Brian Stansberry
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Method Summary
 void add(int arg0, Object arg1)
           
 boolean add(Object arg0)
           
 boolean addAll(Collection arg0)
           
 boolean addAll(int arg0, Collection arg1)
           
 void clear()
           
 Object clone()
           
 boolean contains(Object elem)
           
 boolean containsAll(Collection c)
           
 void ensureCapacity(int arg0)
           
 boolean equals(Object o)
           
 Object get(int index)
           
 int hashCode()
           
 int indexOf(Object elem)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 int lastIndexOf(Object elem)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 Object remove(int arg0)
           
 boolean remove(Object arg0)
           
 boolean removeAll(Collection arg0)
           
protected  void removeRange(int arg0, int arg1)
           
 boolean retainAll(Collection arg0)
           
 Object set(int arg0, Object arg1)
           
 int size()
           
 List subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 String toString()
           
 void trimToSize()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

clone

public Object clone()
Overrides:
clone in class ArrayList

contains

public boolean contains(Object elem)
Specified by:
contains in interface Collection
Specified by:
contains in interface List
Overrides:
contains in class ArrayList

get

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

indexOf

public int indexOf(Object elem)
Specified by:
indexOf in interface List
Overrides:
indexOf in class ArrayList

isEmpty

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

lastIndexOf

public int lastIndexOf(Object elem)
Specified by:
lastIndexOf in interface List
Overrides:
lastIndexOf in class ArrayList

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Overrides:
size in class ArrayList

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class ArrayList

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class ArrayList

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class AbstractList

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class AbstractList

subList

public List subList(int fromIndex,
                    int toIndex)
Specified by:
subList in interface List
Overrides:
subList in class AbstractList

containsAll

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

toString

public String toString()
Overrides:
toString in class AbstractCollection

add

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

add

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

addAll

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

addAll

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

clear

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

ensureCapacity

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

remove

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

remove

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

removeRange

protected void removeRange(int arg0,
                           int arg1)
Overrides:
removeRange in class ArrayList

set

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

trimToSize

public void trimToSize()
Overrides:
trimToSize in class ArrayList

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List
Overrides:
iterator in class AbstractList

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List
Overrides:
listIterator in class AbstractList

listIterator

public ListIterator listIterator(int index)
Specified by:
listIterator in interface List
Overrides:
listIterator in class AbstractList

removeAll

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

retainAll

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


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.