Package jline.console.history
Interface History
- All Superinterfaces:
Iterable<History.Entry>
- All Known Subinterfaces:
PersistentHistory
- All Known Implementing Classes:
FileHistory
,MemoryHistory
Console history.
- Since:
- 2.3
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(CharSequence line) void
clear()
current()
entries()
entries
(int index) get
(int index) int
index()
boolean
isEmpty()
iterator()
boolean
moveTo
(int index) void
boolean
boolean
boolean
next()
boolean
previous()
remove
(int i) Remove the history element at the given index.Remove the first element from history.Remove the last element from historyvoid
replace
(CharSequence item) void
set
(int index, CharSequence item) Set the history item at the given index to the given CharSequence.int
size()
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
size
int size() -
isEmpty
boolean isEmpty() -
index
int index() -
clear
void clear() -
get
-
add
-
set
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
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
CharSequence removeFirst()Remove the first element from history.- Returns:
- the removed element
- Since:
- 2.7
-
removeLast
CharSequence removeLast()Remove the last element from history- Returns:
- the removed element
- Since:
- 2.7
-
replace
-
entries
-
entries
ListIterator<History.Entry> entries() -
iterator
Iterator<History.Entry> iterator()- Specified by:
iterator
in interfaceIterable<History.Entry>
-
current
CharSequence current() -
previous
boolean previous() -
next
boolean next() -
moveToFirst
boolean moveToFirst() -
moveToLast
boolean moveToLast() -
moveTo
boolean moveTo(int index) -
moveToEnd
void moveToEnd()
-