public class DefaultHistory extends Object implements History
History.Entry| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_HISTORY_FILE_SIZE |
static int |
DEFAULT_HISTORY_SIZE |
| Constructor and Description |
|---|
DefaultHistory() |
DefaultHistory(LineReader reader) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Instant time,
String line) |
void |
attach(LineReader reader)
Initialize the history for the given reader.
|
String |
current()
Return the content of the current buffer.
|
int |
first() |
String |
get(int index) |
int |
index() |
protected void |
internalAdd(Instant time,
String line) |
boolean |
isEmpty() |
ListIterator<History.Entry> |
iterator(int index) |
int |
last() |
void |
load()
Load history.
|
protected boolean |
matchPatterns(String patterns,
String line) |
boolean |
moveTo(int index)
Move to the specified index in the history
|
void |
moveToEnd()
Move to the end of the history buffer.
|
boolean |
moveToFirst()
Moves the history index to the first entry.
|
boolean |
moveToLast()
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.
|
void |
purge()
Purge history.
|
void |
save()
Save history.
|
int |
size() |
String |
toString() |
protected void |
trimHistory(Path path,
int max) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static final int DEFAULT_HISTORY_SIZE
public static final int DEFAULT_HISTORY_FILE_SIZE
public DefaultHistory()
public DefaultHistory(LineReader reader)
public void attach(LineReader reader)
Historypublic void load()
throws IOException
Historyload in interface HistoryIOExceptionpublic void purge()
throws IOException
Historypurge in interface HistoryIOExceptionpublic void save()
throws IOException
Historysave in interface HistoryIOExceptionprotected void trimHistory(Path path, int max) throws IOException
IOExceptionpublic ListIterator<History.Entry> iterator(int index)
public boolean moveToLast()
moveToLast in interface Historypublic boolean moveTo(int index)
public boolean moveToFirst()
moveToFirst in interface Historypublic void moveToEnd()
public String current()
public boolean previous()
public boolean next()
Copyright © 2017. All rights reserved.