FileDocCategorySizeDatePackage
ImmutableArrayList.javaAPI DocJBoss 4.2.17470Fri Jul 13 20:52:38 BST 2007org.jboss.ha.framework.interfaces

ImmutableArrayList

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.
author
Brian Stansberry
version
$Revision: 1.1 $

Fields Summary
private static final long
serialVersionUID
The serialVersionUID
private ArrayList
delegate
Constructors Summary
ImmutableArrayList(ArrayList source)


    
   
      this.delegate = source;
   
Methods Summary
public voidadd(int arg0, java.lang.Object arg1)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public booleanadd(java.lang.Object arg0)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public booleanaddAll(java.util.Collection arg0)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public booleanaddAll(int arg0, java.util.Collection arg1)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public voidclear()

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public java.lang.Objectclone()

      return delegate.clone();
   
public booleancontains(java.lang.Object elem)

      return delegate.contains(elem);
   
public booleancontainsAll(java.util.Collection c)

      return delegate.containsAll(c);
   
public voidensureCapacity(int arg0)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public booleanequals(java.lang.Object o)

      return delegate.equals(o);
   
public java.lang.Objectget(int index)

      return delegate.get(index);
   
public inthashCode()

      return delegate.hashCode();
   
public intindexOf(java.lang.Object elem)

      return delegate.indexOf(elem);
   
public booleanisEmpty()

      return delegate.isEmpty();
   
public java.util.Iteratoriterator()

      return new ImmutableArrayListIterator(super.listIterator());
   
public intlastIndexOf(java.lang.Object elem)

      return delegate.lastIndexOf(elem);
   
public java.util.ListIteratorlistIterator()

      return new ImmutableArrayListIterator(super.listIterator());
   
public java.util.ListIteratorlistIterator(int index)

      return new ImmutableArrayListIterator(super.listIterator(index));
   
public java.lang.Objectremove(int arg0)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public booleanremove(java.lang.Object arg0)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public booleanremoveAll(java.util.Collection arg0)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
protected voidremoveRange(int arg0, int arg1)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public booleanretainAll(java.util.Collection arg0)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public java.lang.Objectset(int arg0, java.lang.Object arg1)

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
public intsize()

      return delegate.size();
   
public java.util.ListsubList(int fromIndex, int toIndex)

      return delegate.subList(fromIndex, toIndex);
   
public java.lang.Object[]toArray(java.lang.Object[] a)

      return delegate.toArray(a);
   
public java.lang.Object[]toArray()

      return delegate.toArray();
   
public java.lang.StringtoString()

      return delegate.toString();
   
public voidtrimToSize()

      throw new UnsupportedOperationException("Target list is immutable; mutator methods are not supported");
   
private java.lang.ObjectwriteReplace()

      return delegate;