org.apache.commons.collections.list

Class FixedSizeList

public class FixedSizeList extends AbstractSerializableListDecorator implements BoundedCollection

Decorates another List to fix the size preventing add/remove.

The add, remove, clear and retain operations are unsupported. The set method is allowed (as it doesn't change the list size).

This class is Serializable from Commons Collections 3.1.

Since: Commons Collections 3.0

Version: $Revision: 155406 $ $Date: 2005-02-26 12:55:26 +0000 (Sat, 26 Feb 2005) $

Author: Stephen Colebourne Paul Jack

Constructor Summary
protected FixedSizeList(List list)
Constructor that wraps (not copies).
Method Summary
booleanadd(Object object)
voidadd(int index, Object object)
booleanaddAll(Collection coll)
booleanaddAll(int index, Collection coll)
voidclear()
static Listdecorate(List list)
Factory method to create a fixed size list.
Objectget(int index)
intindexOf(Object object)
booleanisFull()
Iteratoriterator()
intlastIndexOf(Object object)
ListIteratorlistIterator()
ListIteratorlistIterator(int index)
intmaxSize()
Objectremove(int index)
booleanremove(Object object)
booleanremoveAll(Collection coll)
booleanretainAll(Collection coll)
Objectset(int index, Object object)
ListsubList(int fromIndex, int toIndex)

Constructor Detail

FixedSizeList

protected FixedSizeList(List list)
Constructor that wraps (not copies).

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

Throws: IllegalArgumentException if list is null

Method Detail

add

public boolean add(Object object)

add

public void add(int index, Object object)

addAll

public boolean addAll(Collection coll)

addAll

public boolean addAll(int index, Collection coll)

clear

public void clear()

decorate

public static List decorate(List list)
Factory method to create a fixed size list.

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

Throws: IllegalArgumentException if list is null

get

public Object get(int index)

indexOf

public int indexOf(Object object)

isFull

public boolean isFull()

iterator

public Iterator iterator()

lastIndexOf

public int lastIndexOf(Object object)

listIterator

public ListIterator listIterator()

listIterator

public ListIterator listIterator(int index)

maxSize

public int maxSize()

remove

public Object remove(int index)

remove

public boolean remove(Object object)

removeAll

public boolean removeAll(Collection coll)

retainAll

public boolean retainAll(Collection coll)

set

public Object set(int index, Object object)

subList

public List subList(int fromIndex, int toIndex)
Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.