|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.AbstractCollection
java.util.AbstractList
java.util.AbstractSequentialList
java.util.LinkedList
net.spy.util.LimitedList
A LinkedList with a maximum capacity.
| Field Summary |
| Fields inherited from class java.util.AbstractList |
modCount |
| Constructor Summary | |
LimitedList(int l)
Get an instance of Queue. |
|
| Method Summary | |
void |
add(int index,
Object o)
Override add to enforce the limit. |
boolean |
add(Object o)
Override add to enforce the limit. |
boolean |
addAll(Collection c)
Override addAll to enforce the limit. |
boolean |
addAll(int index,
Collection c)
Override addAll to enforce the limit. |
void |
addFirst(Object o)
Override addFirst to enforce the limit. |
void |
addLast(Object o)
Override addLast to enforce the limit. |
int |
getLimit()
Get the maximum number of elements that may be stored in this list. |
void |
setLimit(int to)
Dynamically reset the limit. |
| Methods inherited from class java.util.LinkedList |
clear, clone, contains, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, remove, remove, removeFirst, removeLast, set, size, toArray, toArray |
| Methods inherited from class java.util.AbstractSequentialList |
iterator |
| Methods inherited from class java.util.AbstractList |
equals, hashCode, listIterator, removeRange, subList |
| Methods inherited from class java.util.AbstractCollection |
containsAll, isEmpty, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
containsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, retainAll, subList |
| Constructor Detail |
public LimitedList(int l)
| Method Detail |
public void setLimit(int to)
to - the new limit valuepublic int getLimit()
public void add(int index,
Object o)
index - index at which to addo - object to add
IndexOutOfBoundsException - if the limit is exceeded (or
the parent size thinks it's too big).public boolean add(Object o)
o - object to add
IndexOutOfBoundsException - if the limit is exceeded (or
the parent size thinks it's too big).public void addFirst(Object o)
o - object to add
IndexOutOfBoundsException - if the limit is exceeded (or
the parent size thinks it's too big).public void addLast(Object o)
o - object to add
IndexOutOfBoundsException - if the limit is exceeded (or
the parent size thinks it's too big).
public boolean addAll(int index,
Collection c)
index - the index at which to add the collectionc - Collectoin of objects to add
IndexOutOfBoundsException - if the limit is exceeded (or
the parent size thinks it's too big).public boolean addAll(Collection c)
c - Collectoin of objects to add
IndexOutOfBoundsException - if the limit is exceeded (or
the parent size thinks it's too big).
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||