|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjline.History
public class History
A command history buffer.
Constructor Summary | |
---|---|
History()
Construstor: initialize a blank history. |
|
History(java.io.File historyFile)
Construstor: initialize History object the the specified File for
storage. |
Method Summary | |
---|---|
void |
addToHistory(java.lang.String buffer)
Add the specified buffer to the end of the history. |
void |
clear()
Clear the history buffer |
java.lang.String |
current()
Return the content of the current buffer. |
void |
flushBuffer()
Flush the entire history buffer to the output PrintWriter. |
int |
getCurrentIndex()
Returns the current history index. |
java.lang.String |
getHistory(int index)
Get the history string for the given index. |
java.util.List |
getHistoryList()
Returns an immutable list of the history buffer. |
int |
getMaxSize()
Get the maximum size that the history buffer will store. |
java.io.PrintWriter |
getOutput()
Returns the PrintWriter that is used to store history elements. |
void |
load(java.io.InputStream in)
Load the history buffer from the specified InputStream. |
void |
load(java.io.Reader reader)
Load the history buffer from the specified Reader. |
void |
moveToEnd()
Move to the end of the history buffer. |
boolean |
moveToFirstEntry()
Moves the history index to the first entry. |
boolean |
moveToLastEntry()
This moves the history to the last entry. |
boolean |
next()
Move the pointer to the next element in the buffer. |
boolean |
previous()
Move the pointer to the previous element in the buffer. |
int |
searchBackwards(java.lang.String s)
Search backwards in history from the current position. |
int |
searchBackwards(java.lang.String searchTerm,
int startIndex)
Search backward in history from a given position. |
void |
setCurrentIndex(int index)
Set current index to given number. |
void |
setHistoryFile(java.io.File historyFile)
|
void |
setMaxSize(int maxSize)
Set the maximum size that the history buffer will store. |
void |
setOutput(java.io.PrintWriter output)
The output to which all history elements will be written (or null of history is not saved to a buffer). |
int |
size()
|
java.lang.String |
toString()
Returns the standard AbstractCollection.toString() representation
of the history list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public History()
public History(java.io.File historyFile) throws java.io.IOException
File
for
storage.
java.io.IOException
Method Detail |
---|
public void setHistoryFile(java.io.File historyFile) throws java.io.IOException
java.io.IOException
public void load(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public void load(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public int size()
public void clear()
public void addToHistory(java.lang.String buffer)
public void flushBuffer() throws java.io.IOException
java.io.IOException
public boolean moveToLastEntry()
public void moveToEnd()
public void setMaxSize(int maxSize)
public int getMaxSize()
public void setOutput(java.io.PrintWriter output)
public java.io.PrintWriter getOutput()
public int getCurrentIndex()
public java.lang.String current()
public boolean previous()
public boolean next()
public java.util.List getHistoryList()
public java.lang.String toString()
AbstractCollection.toString()
representation
of the history list.
toString
in class java.lang.Object
public boolean moveToFirstEntry()
public int searchBackwards(java.lang.String searchTerm, int startIndex)
searchTerm
- substring to search for.startIndex
- the index from which on to search
public int searchBackwards(java.lang.String s)
searchTerm
- substring to search for.
public java.lang.String getHistory(int index)
index
-
public void setCurrentIndex(int index)
index
-
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |