|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.collections4.collection.AbstractCollectionDecorator<E>
org.apache.commons.collections4.list.AbstractListDecorator<E>
org.apache.commons.collections4.list.AbstractSerializableListDecorator<E>
org.apache.commons.collections4.list.FixedSizeList<E>
public class FixedSizeList<E>
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.
| Constructor Summary | |
|---|---|
protected |
FixedSizeList(List<E> list)
Constructor that wraps (not copies). |
| Method Summary | ||
|---|---|---|
boolean |
add(E object)
|
|
void |
add(int index,
E object)
|
|
boolean |
addAll(Collection<? extends E> coll)
|
|
boolean |
addAll(int index,
Collection<? extends E> coll)
|
|
void |
clear()
|
|
static
|
fixedSizeList(List<E> list)
Factory method to create a fixed size list. |
|
E |
get(int index)
|
|
int |
indexOf(Object object)
|
|
boolean |
isFull()
Returns true if this collection is full and no new elements can be added. |
|
Iterator<E> |
iterator()
|
|
int |
lastIndexOf(Object object)
|
|
ListIterator<E> |
listIterator()
|
|
ListIterator<E> |
listIterator(int index)
|
|
int |
maxSize()
Gets the maximum size of the collection (the bound). |
|
E |
remove(int index)
|
|
boolean |
remove(Object object)
|
|
boolean |
removeAll(Collection<?> coll)
|
|
boolean |
retainAll(Collection<?> coll)
|
|
E |
set(int index,
E object)
|
|
List<E> |
subList(int fromIndex,
int toIndex)
|
|
| Methods inherited from class org.apache.commons.collections4.list.AbstractListDecorator |
|---|
decorated |
| Methods inherited from class org.apache.commons.collections4.collection.AbstractCollectionDecorator |
|---|
contains, containsAll, equals, hashCode, isEmpty, setCollection, size, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Collection |
|---|
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray |
| Methods inherited from interface java.util.List |
|---|
contains, containsAll, equals, hashCode, isEmpty, size, toArray, toArray |
| Constructor Detail |
|---|
protected FixedSizeList(List<E> list)
list - the list to decorate, must not be null
IllegalArgumentException - if list is null| Method Detail |
|---|
public static <E> FixedSizeList<E> fixedSizeList(List<E> list)
E - the type of the elements in the listlist - the list to decorate, must not be null
IllegalArgumentException - if list is nullpublic boolean add(E object)
add in interface Collection<E>add in interface List<E>add in class AbstractCollectionDecorator<E>
public void add(int index,
E object)
add in interface List<E>add in class AbstractListDecorator<E>public boolean addAll(Collection<? extends E> coll)
addAll in interface Collection<E>addAll in interface List<E>addAll in class AbstractCollectionDecorator<E>
public boolean addAll(int index,
Collection<? extends E> coll)
addAll in interface List<E>addAll in class AbstractListDecorator<E>public void clear()
clear in interface Collection<E>clear in interface List<E>clear in class AbstractCollectionDecorator<E>public E get(int index)
get in interface List<E>get in class AbstractListDecorator<E>public int indexOf(Object object)
indexOf in interface List<E>indexOf in class AbstractListDecorator<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface List<E>iterator in class AbstractCollectionDecorator<E>public int lastIndexOf(Object object)
lastIndexOf in interface List<E>lastIndexOf in class AbstractListDecorator<E>public ListIterator<E> listIterator()
listIterator in interface List<E>listIterator in class AbstractListDecorator<E>public ListIterator<E> listIterator(int index)
listIterator in interface List<E>listIterator in class AbstractListDecorator<E>public E remove(int index)
remove in interface List<E>remove in class AbstractListDecorator<E>public boolean remove(Object object)
remove in interface Collection<E>remove in interface List<E>remove in class AbstractCollectionDecorator<E>public boolean removeAll(Collection<?> coll)
removeAll in interface Collection<E>removeAll in interface List<E>removeAll in class AbstractCollectionDecorator<E>public boolean retainAll(Collection<?> coll)
retainAll in interface Collection<E>retainAll in interface List<E>retainAll in class AbstractCollectionDecorator<E>
public E set(int index,
E object)
set in interface List<E>set in class AbstractListDecorator<E>
public List<E> subList(int fromIndex,
int toIndex)
subList in interface List<E>subList in class AbstractListDecorator<E>public boolean isFull()
BoundedCollection
isFull in interface BoundedCollection<E>true if the collection is fullpublic int maxSize()
BoundedCollection
maxSize in interface BoundedCollection<E>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||