org.apache.commons.collections.list

Class UnmodifiableList

Implemented Interfaces:
Collection, List, Serializable, Unmodifiable

public final class UnmodifiableList
extends AbstractSerializableListDecorator
implements Unmodifiable

Decorates another List to ensure it can't be altered.

This class is Serializable from Commons Collections 3.1.

Version:
$Revision: 1.7 $ $Date: 2004/06/03 22:02:13 $

Author:
Stephen Colebourne

Since:
Commons Collections 3.0

Field Summary

Fields inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator

collection

Method Summary

boolean
add(Object object)
void
add(int index, Object object)
boolean
addAll(Collection coll)
boolean
addAll(int index, Collection coll)
void
clear()
static List
decorate(List list)
Factory method to create an unmodifiable list.
Iterator
iterator()
ListIterator
listIterator()
ListIterator
listIterator(int index)
boolean
remove(Object object)
Object
remove(int index)
boolean
removeAll(Collection coll)
boolean
retainAll(Collection coll)
Object
set(int index, Object object)
List
subList(int fromIndex, int toIndex)

Methods inherited from class org.apache.commons.collections.list.AbstractListDecorator

add, addAll, get, getList, indexOf, lastIndexOf, listIterator, listIterator, remove, set, subList

Methods inherited from class org.apache.commons.collections.collection.AbstractCollectionDecorator

add, addAll, clear, contains, containsAll, equals, getCollection, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString

Method Details

add

public boolean add(Object object)
Overrides:
add in interface AbstractCollectionDecorator


add

public void add(int index,
                Object object)
Overrides:
add in interface AbstractListDecorator


addAll

public boolean addAll(Collection coll)
Overrides:
addAll in interface AbstractCollectionDecorator


addAll

public boolean addAll(int index,
                      Collection coll)
Overrides:
addAll in interface AbstractListDecorator


clear

public void clear()
Overrides:
clear in interface AbstractCollectionDecorator


decorate

public static List decorate(List list)
Factory method to create an unmodifiable list.

Parameters:
list - the list to decorate, must not be null


iterator

public Iterator iterator()
Overrides:
iterator in interface AbstractCollectionDecorator


listIterator

public ListIterator listIterator()
Overrides:
listIterator in interface AbstractListDecorator


listIterator

public ListIterator listIterator(int index)
Overrides:
listIterator in interface AbstractListDecorator


remove

public boolean remove(Object object)
Overrides:
remove in interface AbstractCollectionDecorator


remove

public Object remove(int index)
Overrides:
remove in interface AbstractListDecorator


removeAll

public boolean removeAll(Collection coll)
Overrides:
removeAll in interface AbstractCollectionDecorator


retainAll

public boolean retainAll(Collection coll)
Overrides:
retainAll in interface AbstractCollectionDecorator


set

public Object set(int index,
                  Object object)
Overrides:
set in interface AbstractListDecorator


subList

public List subList(int fromIndex,
                    int toIndex)
Overrides:
subList in interface AbstractListDecorator


Copyright © 2001-2005 Apache Software Foundation. All Rights Reserved.