public class

FixedSizeList

extends AbstractSerializableListDecorator
implements BoundedCollection
java.lang.Object
   ↳ org.apache.commons.collections.collection.AbstractCollectionDecorator
     ↳ org.apache.commons.collections.list.AbstractListDecorator
       ↳ org.apache.commons.collections.list.AbstractSerializableListDecorator
         ↳ org.apache.commons.collections.list.FixedSizeList

Class Overview

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.

Summary

[Expand]
Inherited Fields
From class org.apache.commons.collections.collection.AbstractCollectionDecorator
Protected Constructors
FixedSizeList(List list)
Constructor that wraps (not copies).
Public Methods
void add(int index, Object object)
boolean add(Object object)
boolean addAll(Collection coll)
boolean addAll(int index, Collection coll)
void clear()
static List decorate(List list)
Factory method to create a fixed size list.
Object get(int index)
int indexOf(Object object)
boolean isFull()
Returns true if this collection is full and no new elements can be added.
Iterator iterator()
int lastIndexOf(Object object)
ListIterator listIterator(int index)
ListIterator listIterator()
int maxSize()
Gets the maximum size of the collection (the bound).
Object remove(int index)
boolean remove(Object object)
boolean removeAll(Collection coll)
boolean retainAll(Collection coll)
Object set(int index, Object object)
List subList(int fromIndex, int toIndex)
[Expand]
Inherited Methods
From class org.apache.commons.collections.list.AbstractListDecorator
From class org.apache.commons.collections.collection.AbstractCollectionDecorator
From class java.lang.Object
From interface java.lang.Iterable
From interface java.util.Collection
From interface java.util.List
From interface org.apache.commons.collections.BoundedCollection

Protected Constructors

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

Public Methods

public void add (int index, Object object)

public boolean add (Object object)

public boolean addAll (Collection coll)

public boolean addAll (int index, Collection coll)

public void clear ()

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

public Object get (int index)

public int indexOf (Object object)

public boolean isFull ()

Returns true if this collection is full and no new elements can be added.

Returns
  • true if the collection is full

public Iterator iterator ()

public int lastIndexOf (Object object)

public ListIterator listIterator (int index)

public ListIterator listIterator ()

public int maxSize ()

Gets the maximum size of the collection (the bound).

Returns
  • the maximum number of elements the collection can hold

public Object remove (int index)

public boolean remove (Object object)

public boolean removeAll (Collection coll)

public boolean retainAll (Collection coll)

public Object set (int index, Object object)

public List subList (int fromIndex, int toIndex)