|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.uifextras.history.HistoryList<E>
E
- the type of the list elementspublic final class HistoryList<E>
Provides behavior for getting forward and backward in a fixed list of recently used items. Used by back and forward navigation buttons.
Constructor Summary | |
---|---|
HistoryList(int limit)
Constructs a HistoryList with the given capacity limit. |
Method Summary | |
---|---|
boolean |
add(E o)
Adds an element to the history if it is not the previous element. |
E |
getAndGoNext()
Returns the next element and goes next - if possible. |
E |
getAndGoPrevious()
Returns the previous element and goes back - if possible. |
Iterator<E> |
getBackIterator()
Returns an Iterator for the available backward elements. |
E |
getLastAdded()
Returns the element that was added last. |
E |
getNext()
Returns the next element. |
Iterator<E> |
getNextIterator()
Returns an Iterator for the available next elements. |
E |
getPrevious()
Returns the previous element. |
void |
goBack(int steps)
Goes back the specified number of steps. |
void |
goNext(int steps)
Goes forward the specified number of steps. |
boolean |
hasNext()
Checks and answer if there's a next element. |
boolean |
hasPrevious()
Checks and answers if there's a previous element. |
void |
removeAll(E item)
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public HistoryList(int limit)
HistoryList
with the given capacity limit.
limit
- the upper bound for the list's capacityMethod Detail |
---|
public boolean add(E o)
o
- the object to add
public void removeAll(E item)
public E getAndGoPrevious()
public E getAndGoNext()
public Iterator<E> getBackIterator()
Iterator
for the available backward elements.
public Iterator<E> getNextIterator()
Iterator
for the available next elements.
public E getLastAdded()
public E getPrevious()
public E getNext()
public void goBack(int steps)
steps
- the number of steps to go backpublic void goNext(int steps)
steps
- the number of steps to go forwardpublic boolean hasPrevious()
public boolean hasNext()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |