|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iu.cnets.klatsch.misc.History
public class History
This class encapsulates the idea of a history of previous lines of input, which is useful to both the line editor and the GUI.
Field Summary | |
---|---|
(package private) int |
current
the current pointer within the history |
static int |
DEFAULT_SIZE
the default history size |
(package private) java.util.List<java.lang.String> |
ls
the previous lines of input |
(package private) int |
maxLines
the maximum number of lines to retain |
Constructor Summary | |
---|---|
History()
Initialize a new history of the default size. |
|
History(int size)
Initialize a new history of the given size. |
Method Summary | |
---|---|
void |
add(java.lang.String line)
Adds a new line to the history. |
java.lang.String |
get()
Gets the current line in the history. |
void |
next()
Moves the current pointer to the next position. |
void |
prev()
Moves the current pointer to the previous position. |
void |
reset()
Resets the position of the current pointer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULT_SIZE
java.util.List<java.lang.String> ls
int maxLines
int current
Constructor Detail |
---|
public History()
public History(int size)
Method Detail |
---|
public void add(java.lang.String line)
line
- the line to addpublic java.lang.String get()
public void next()
public void prev()
public void reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |