Package org.jline.reader.impl.history
Class DefaultHistory.EntryImpl
- java.lang.Object
-
- org.jline.reader.impl.history.DefaultHistory.EntryImpl
-
- All Implemented Interfaces:
History.Entry
- Enclosing class:
- DefaultHistory
protected static class DefaultHistory.EntryImpl extends java.lang.Object implements History.Entry
Default implementation of theHistory.Entryinterface.This class represents a single history entry with an index, timestamp, and command text.
-
-
Constructor Summary
Constructors Constructor Description EntryImpl(int index, java.time.Instant time, java.lang.String line)Creates a new history entry with the specified index, timestamp, and line.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intindex()Returns the index of this entry in the history.java.lang.Stringline()Returns the command line text of this entry.java.time.Instanttime()Returns the timestamp when this entry was added to the history.java.lang.StringtoString()
-
-
-
Constructor Detail
-
EntryImpl
public EntryImpl(int index, java.time.Instant time, java.lang.String line)Creates a new history entry with the specified index, timestamp, and line.- Parameters:
index- the index of the entry in the historytime- the timestamp of the entryline- the content of the entry
-
-
Method Detail
-
index
public int index()
Description copied from interface:History.EntryReturns the index of this entry in the history.- Specified by:
indexin interfaceHistory.Entry- Returns:
- the index position of this entry
-
time
public java.time.Instant time()
Description copied from interface:History.EntryReturns the timestamp when this entry was added to the history.- Specified by:
timein interfaceHistory.Entry- Returns:
- the timestamp of this entry
-
line
public java.lang.String line()
Description copied from interface:History.EntryReturns the command line text of this entry.- Specified by:
linein interfaceHistory.Entry- Returns:
- the command line text
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-