Package jline.console.history
Interface History
-
- All Superinterfaces:
java.lang.Iterable<History.Entry>
- All Known Subinterfaces:
PersistentHistory
- All Known Implementing Classes:
FileHistory,MemoryHistory
public interface History extends java.lang.Iterable<History.Entry>
Console history.- Since:
- 2.3
- Author:
- Marc Prud'hommeaux, Jason Dillon
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceHistory.Entry
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidadd(java.lang.CharSequence line)voidclear()java.lang.CharSequencecurrent()java.util.ListIterator<History.Entry>entries()java.util.ListIterator<History.Entry>entries(int index)java.lang.CharSequenceget(int index)intindex()booleanisEmpty()java.util.Iterator<History.Entry>iterator()booleanmoveTo(int index)voidmoveToEnd()booleanmoveToFirst()booleanmoveToLast()booleannext()booleanprevious()java.lang.CharSequenceremove(int i)Remove the history element at the given index.java.lang.CharSequenceremoveFirst()Remove the first element from history.java.lang.CharSequenceremoveLast()Remove the last element from historyvoidreplace(java.lang.CharSequence item)voidset(int index, java.lang.CharSequence item)Set the history item at the given index to the given CharSequence.intsize()
-
-
-
Method Detail
-
size
int size()
-
isEmpty
boolean isEmpty()
-
index
int index()
-
clear
void clear()
-
get
java.lang.CharSequence get(int index)
-
add
void add(java.lang.CharSequence line)
-
set
void set(int index, java.lang.CharSequence item)Set the history item at the given index to the given CharSequence.- Parameters:
index- the index of the history offsetitem- the new item- Since:
- 2.7
-
remove
java.lang.CharSequence remove(int i)
Remove the history element at the given index.- Parameters:
i- the index of the element to remove- Returns:
- the removed element
- Since:
- 2.7
-
removeFirst
java.lang.CharSequence removeFirst()
Remove the first element from history.- Returns:
- the removed element
- Since:
- 2.7
-
removeLast
java.lang.CharSequence removeLast()
Remove the last element from history- Returns:
- the removed element
- Since:
- 2.7
-
replace
void replace(java.lang.CharSequence item)
-
entries
java.util.ListIterator<History.Entry> entries(int index)
-
entries
java.util.ListIterator<History.Entry> entries()
-
iterator
java.util.Iterator<History.Entry> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<History.Entry>
-
current
java.lang.CharSequence current()
-
previous
boolean previous()
-
next
boolean next()
-
moveToFirst
boolean moveToFirst()
-
moveToLast
boolean moveToLast()
-
moveTo
boolean moveTo(int index)
-
moveToEnd
void moveToEnd()
-
-