|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.jaxfront.core.util.RollingList
T - The type if items that this list containspublic class RollingList
Implements a "rolling list". A rolling list has a maximum capacity, and removes the oldest elements from the list to maintain this capacity.
| Constructor Summary | |
|---|---|
RollingList(int capacity)
Creates a new RollingList of the specified capacity. |
|
RollingList(int capacity,
boolean rolingGet)
|
|
RollingList(int capacity,
java.lang.Object empty)
Creates a new RollingList of the specified capacity, with the specified "empty" element appended to the end. |
|
RollingList(java.util.List rolingItems,
boolean rolingGet)
|
|
RollingList(java.lang.Object[] rolingItems,
boolean rolingGet)
|
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object e)
Adds the specified item to this list. |
void |
append(int pos,
java.lang.Object e)
Append the specified item to this list. |
void |
append(java.lang.Object e)
Append the specified item to this list. |
void |
clear()
Clears all items from this list. |
boolean |
contains(java.lang.Object o)
Determines if this list contains the specified object. |
java.lang.Object |
get(int index)
Retrieves the item at the specified index in this list. |
java.lang.Object |
getCurrent()
|
java.util.List |
getList()
Retrieves a list of items that this rolling list contains. |
java.lang.Object |
getNext()
Retrieves the element after the positional pointer of the list. |
int |
getPosition()
Retrieves the current position within the list. |
java.lang.Object |
getPrevious()
Retrieves the element before the positional pointer of the list. |
boolean |
hasNext()
Determines if there is an element after the positional pointer of the list. |
boolean |
hasPrevious()
Determines if there is an element befpre the positional pointer of the list. |
boolean |
isEmpty()
Determines if this list is currently empty. |
static void |
main(java.lang.String[] args)
|
boolean |
remove(java.lang.Object o)
Removes the specified element from this list. |
void |
rollingGet(boolean rollingGet)
|
void |
seekTo(java.lang.Object o)
|
void |
seekToEnd()
Sets the positional pointer of this list to the end. |
void |
seekToStart()
Sets the positional pointer of this list to the start. |
void |
setPosition(int position)
Sets the positional pointer of this list. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RollingList(int capacity)
capacity - The capacity of this list.
public RollingList(int capacity,
boolean rolingGet)
public RollingList(int capacity,
java.lang.Object empty)
capacity - The capacity of this list.empty - The "empty" element to be added
public RollingList(java.util.List rolingItems,
boolean rolingGet)
public RollingList(java.lang.Object[] rolingItems,
boolean rolingGet)
| Method Detail |
|---|
public boolean add(java.lang.Object e)
e - The element to be added to the list.
public void append(int pos,
java.lang.Object e)
e - The element to be added to the list.public void append(java.lang.Object e)
e - The element to be added to the list.public void clear()
public boolean contains(java.lang.Object o)
o - The object to be checked
public java.lang.Object get(int index)
index - The index to look up
public java.lang.Object getCurrent()
public java.util.List getList()
public java.lang.Object getNext()
public int getPosition()
public java.lang.Object getPrevious()
public boolean hasNext()
public boolean hasPrevious()
public boolean isEmpty()
public static void main(java.lang.String[] args)
public boolean remove(java.lang.Object o)
o - The object to be removed from the list.
public void rollingGet(boolean rollingGet)
public void seekTo(java.lang.Object o)
public void seekToEnd()
public void seekToStart()
public void setPosition(int position)
position - The new position
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||