public class

MemoryHistory

extends Object
implements History
java.lang.Object
   ↳ jline.console.history.MemoryHistory
Known Direct Subclasses

Class Overview

Non-persistent History.

Summary

Constants
int DEFAULT_MAX_SIZE
Public Constructors
MemoryHistory()
Public Methods
void add(CharSequence item)
void clear()
CharSequence current()
Return the content of the current buffer.
ListIterator<History.Entry> entries(int index)
ListIterator<History.Entry> entries()
CharSequence get(int index)
int getMaxSize()
int index()
boolean isAutoTrim()
boolean isEmpty()
boolean isIgnoreDuplicates()
Iterator<History.Entry> iterator()
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.
CharSequence remove(int i)
Remove the history element at the given index.
CharSequence removeFirst()
Remove the first element from history.
CharSequence removeLast()
Remove the last element from history
void replace(CharSequence item)
void set(int index, CharSequence item)
Set the history item at the given index to the given CharSequence.
void setAutoTrim(boolean flag)
void setIgnoreDuplicates(boolean flag)
void setMaxSize(int maxSize)
int size()
String toString()
Protected Methods
void internalAdd(CharSequence item)
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.lang.Iterable
From interface jline.console.history.History

Constants

public static final int DEFAULT_MAX_SIZE

Constant Value: 500 (0x000001f4)

Public Constructors

public MemoryHistory ()

Public Methods

public void add (CharSequence item)

public void clear ()

public CharSequence current ()

Return the content of the current buffer.

public ListIterator<History.Entry> entries (int index)

public ListIterator<History.Entry> entries ()

public CharSequence get (int index)

public int getMaxSize ()

public int index ()

public boolean isAutoTrim ()

public boolean isEmpty ()

public boolean isIgnoreDuplicates ()

public Iterator<History.Entry> iterator ()

public boolean moveTo (int index)

Move to the specified index in the history

public void moveToEnd ()

Move to the end of the history buffer. This will be a blank entry, after all of the other entries.

public boolean moveToFirst ()

Moves the history index to the first entry.

Returns
  • Return false if there are no entries in the history or if the history is already at the beginning.

public boolean moveToLast ()

This moves the history to the last entry. This entry is one position before the moveToEnd() position.

Returns
  • Returns false if there were no history entries or the history index was already at the last entry.

public boolean next ()

Move the pointer to the next element in the buffer.

Returns
  • true if we successfully went to the next element

public boolean previous ()

Move the pointer to the previous element in the buffer.

Returns
  • true if we successfully went to the previous element

public 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

public CharSequence removeFirst ()

Remove the first element from history.

Returns
  • the removed element

public CharSequence removeLast ()

Remove the last element from history

Returns
  • the removed element

public void replace (CharSequence item)

public void set (int index, CharSequence item)

Set the history item at the given index to the given CharSequence.

Parameters
index the index of the history offset
item the new item

public void setAutoTrim (boolean flag)

public void setIgnoreDuplicates (boolean flag)

public void setMaxSize (int maxSize)

public int size ()

public String toString ()

Protected Methods

protected void internalAdd (CharSequence item)