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.
| Method from org.apache.commons.collections.list.FixedSizeList Detail: |
public boolean add(Object object) {
throw new UnsupportedOperationException("List is fixed size");
}
|
public void add(int index,
Object object) {
throw new UnsupportedOperationException("List is fixed size");
}
|
public boolean addAll(Collection coll) {
throw new UnsupportedOperationException("List is fixed size");
}
|
public boolean addAll(int index,
Collection coll) {
throw new UnsupportedOperationException("List is fixed size");
}
|
public void clear() {
throw new UnsupportedOperationException("List is fixed size");
}
|
public static List decorate(List list) {
return new FixedSizeList(list);
}
Factory method to create a fixed size list. |
public Object get(int index) {
return getList().get(index);
}
|
public int indexOf(Object object) {
return getList().indexOf(object);
}
|
public boolean isFull() {
return true;
}
|
public Iterator iterator() {
return UnmodifiableIterator.decorate(getCollection().iterator());
}
|
public int lastIndexOf(Object object) {
return getList().lastIndexOf(object);
}
|
public ListIterator listIterator() {
return new FixedSizeListIterator(getList().listIterator(0));
}
|
public ListIterator listIterator(int index) {
return new FixedSizeListIterator(getList().listIterator(index));
}
|
public int maxSize() {
return size();
}
|
public Object remove(int index) {
throw new UnsupportedOperationException("List is fixed size");
}
|
public boolean remove(Object object) {
throw new UnsupportedOperationException("List is fixed size");
}
|
public boolean removeAll(Collection coll) {
throw new UnsupportedOperationException("List is fixed size");
}
|
public boolean retainAll(Collection coll) {
throw new UnsupportedOperationException("List is fixed size");
}
|
public Object set(int index,
Object object) {
return getList().set(index, object);
}
|
public List subList(int fromIndex,
int toIndex) {
List sub = getList().subList(fromIndex, toIndex);
return new FixedSizeList(sub);
}
|