|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.AbstractCollection | +--java.util.AbstractList | +--java.util.ArrayList | +--jimmc.util.LimitedList
A list with a limited size.
When an item is appended to the list past the limit size,
an item from the start of the list is removed to maintain the list size.
NOTE: Only the addLimited(Object)
method currently
implements the limit checking.
Field Summary | |
protected int |
limit
The current maximum size of the list. |
Fields inherited from class java.util.AbstractList |
modCount |
Constructor Summary | |
LimitedList(int initialLimit)
Create a LimitedList. |
Method Summary | |
void |
addLimited(java.lang.Object obj)
Add an element to the list. |
int |
getLimit()
Get the current maximum size of the list. |
void |
setLimit(int limit)
Set the maximum size of the list. |
void |
truncate(int position)
Remove all items from the specified position, inclusive, to the end of the list. |
Methods inherited from class java.util.ArrayList |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, set, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
containsAll, remove, 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, iterator, listIterator, listIterator, remove, removeAll, retainAll, subList |
Field Detail |
protected int limit
Constructor Detail |
public LimitedList(int initialLimit)
initialLimit
- The initial capacity and limit.Method Detail |
public void setLimit(int limit)
public int getLimit()
public void addLimited(java.lang.Object obj)
public void truncate(int position)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |