⇒ Index (Frames) |  ⇒ Index (No Frames) |  ⇒ Package |  ⇒ Package Tree |  ⇒ Full Tree 
org.apache.commons.collections.list

Class UnmodifiableList

java.lang.Object
|
+--org.apache.commons.collections.collection.AbstractCollectionDecorator
   |
   +--org.apache.commons.collections.list.AbstractListDecorator
      |
      +--org.apache.commons.collections.list.UnmodifiableList

All Implemented Interfaces:
Collection, List, Unmodifiable


public final class UnmodifiableList
extends AbstractListDecorator
implements Unmodifiable

Decorates another List to ensure it can't be altered.
Since:
Commons Collections 3.0
Author:
Stephen Colebourne

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)

Method Details

add

public void add(int index, Object object)

Parameters:
index
object

add

public boolean add(Object object)

Parameters:
object

addAll

public boolean addAll(Collection coll)

Parameters:
coll

addAll

public boolean addAll(int index, Collection coll)

Parameters:
index
coll

clear

public void clear()


decorate

public static List decorate(List list)

Factory method to create an unmodifiable list.

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

iterator

public Iterator iterator()


listIterator

public ListIterator listIterator()


listIterator

public ListIterator listIterator(int index)

Parameters:
index

remove

public Object remove(int index)

Parameters:
index

remove

public boolean remove(Object object)

Parameters:
object

removeAll

public boolean removeAll(Collection coll)

Parameters:
coll

retainAll

public boolean retainAll(Collection coll)

Parameters:
coll

set

public Object set(int index, Object object)

Parameters:
index
object

subList

public List subList(int fromIndex, int toIndex)

Parameters:
fromIndex
toIndex