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.Entry
interface.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 int
index()
Returns the index of this entry in the history.java.lang.String
line()
Returns the command line text of this entry.java.time.Instant
time()
Returns the timestamp when this entry was added to the history.java.lang.String
toString()
-
-
-
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.Entry
Returns the index of this entry in the history.- Specified by:
index
in interfaceHistory.Entry
- Returns:
- the index position of this entry
-
time
public java.time.Instant time()
Description copied from interface:History.Entry
Returns the timestamp when this entry was added to the history.- Specified by:
time
in interfaceHistory.Entry
- Returns:
- the timestamp of this entry
-
line
public java.lang.String line()
Description copied from interface:History.Entry
Returns the command line text of this entry.- Specified by:
line
in interfaceHistory.Entry
- Returns:
- the command line text
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-