public class FixedSizeList extends AbstractSerializableListDecorator implements BoundedCollection
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.
collection| Modifier | Constructor and Description |
|---|---|
protected |
FixedSizeList(List list)
Constructor that wraps (not copies).
|
| Modifier and Type | Method and Description |
|---|---|
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() |
ListIterator |
listIterator(int index) |
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) |
getListcontains, containsAll, equals, getCollection, hashCode, isEmpty, size, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, containsAll, equals, hashCode, isEmpty, size, toArray, toArrayprotected FixedSizeList(List list)
list - the list to decorate, must not be nullIllegalArgumentException - if list is nullpublic static List decorate(List list)
list - the list to decorate, must not be nullIllegalArgumentException - if list is nullpublic boolean add(Object object)
add in interface Collectionadd in interface Listadd in class AbstractCollectionDecoratorpublic void add(int index,
Object object)
add in interface Listadd in class AbstractListDecoratorpublic boolean addAll(Collection coll)
addAll in interface CollectionaddAll in interface ListaddAll in class AbstractCollectionDecoratorpublic boolean addAll(int index,
Collection coll)
addAll in interface ListaddAll in class AbstractListDecoratorpublic void clear()
clear in interface Collectionclear in interface Listclear in class AbstractCollectionDecoratorpublic Object get(int index)
get in interface Listget in class AbstractListDecoratorpublic int indexOf(Object object)
indexOf in interface ListindexOf in class AbstractListDecoratorpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Listiterator in class AbstractCollectionDecoratorpublic int lastIndexOf(Object object)
lastIndexOf in interface ListlastIndexOf in class AbstractListDecoratorpublic ListIterator listIterator()
listIterator in interface ListlistIterator in class AbstractListDecoratorpublic ListIterator listIterator(int index)
listIterator in interface ListlistIterator in class AbstractListDecoratorpublic Object remove(int index)
remove in interface Listremove in class AbstractListDecoratorpublic boolean remove(Object object)
remove in interface Collectionremove in interface Listremove in class AbstractCollectionDecoratorpublic boolean removeAll(Collection coll)
removeAll in interface CollectionremoveAll in interface ListremoveAll in class AbstractCollectionDecoratorpublic boolean retainAll(Collection coll)
retainAll in interface CollectionretainAll in interface ListretainAll in class AbstractCollectionDecoratorpublic Object set(int index, Object object)
set in interface Listset in class AbstractListDecoratorpublic List subList(int fromIndex, int toIndex)
subList in interface ListsubList in class AbstractListDecoratorpublic boolean isFull()
BoundedCollectionisFull in interface BoundedCollectiontrue if the collection is fullpublic int maxSize()
BoundedCollectionmaxSize in interface BoundedCollectionCopyright © 2001–2015 The Apache Software Foundation. All rights reserved.