|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.crosswire.common.history.History
public class History
Maintains a navigable history of objects. This maintains a dated list of objects and a current navigation list.
for license details.
The copyright to this program is held by it's authors.
Field Summary | |
---|---|
private int |
backCount
The number of elements in the "back" list. |
private Map |
history
A map of elements that have been seen so far to when they have been seen. |
private EventListenerList |
listeners
Listeners that are interested when history has changed. |
private List |
nav
The elements that can be navigated. |
Constructor Summary | |
---|---|
History()
Create an empty navigation and history list. |
Method Summary | |
---|---|
void |
add(Object obj)
Add an element to history. |
void |
addHistoryListener(HistoryListener li)
Add a listener for history events. |
private void |
fireHistoryChanged()
Kick of an event sequence |
Object |
getCurrent()
Get the current item in the "back" list |
List |
getNextList()
Get all the elements in the "forward" list. |
List |
getPreviousList()
Get all the elements in "back" list. |
Object |
go(int i)
Increments the current history item by the given amount. |
void |
removeHistoryListener(HistoryListener li)
Remove a listener of history events. |
Object |
select(int index)
Make a particular element in the navigation list the current item in history. |
private void |
visit(Object obj)
Note that this object has been seen at this time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private List nav
private Map history
private int backCount
private EventListenerList listeners
Constructor Detail |
---|
public History()
Method Detail |
---|
public Object select(int index)
index
- the index of item to make the last one in the back list,
-1 (or lower) will put everything in the forward list.
Indexes beyond the end of the list will put everything
in the back list.public void add(Object obj)
obj
- public List getPreviousList()
public List getNextList()
public Object go(int i)
i
- the distance to travel
public Object getCurrent()
public void addHistoryListener(HistoryListener li)
li
- the interested listenerpublic void removeHistoryListener(HistoryListener li)
li
- the disinterested listenerprivate void visit(Object obj)
obj
- private void fireHistoryChanged()
|
Copyright ? 2003-2006 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |