org.basex.util
Class History

java.lang.Object
  extended by org.basex.util.History

public final class History
extends java.lang.Object

This class stores strings in a history.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Constructor Summary
History(byte[] text)
          Constructor.
 
Method Summary
 boolean active()
          Indicates if the history is active.
 int cursor()
          Returns the cursor position.
 boolean first()
          Checks if the history points to the first entry.
 boolean last()
          Checks if the history points to the last entry.
 boolean modified()
          Checks if the file has been modified.
 byte[] next()
          Returns the next string and increases the pointer, or returns null.
 byte[] prev()
          Returns the previous string and decreases the pointer, or returns null.
 void save()
          Sets the saved position.
 void store(byte[] str, int oc, int nc)
          Stores a string in the history.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

History

public History(byte[] text)
Constructor.

Parameters:
text - initial text
Method Detail

active

public boolean active()
Indicates if the history is active.

Returns:
result of check

first

public boolean first()
Checks if the history points to the first entry.

Returns:
result of check

last

public boolean last()
Checks if the history points to the last entry.

Returns:
result of check

prev

public byte[] prev()
Returns the previous string and decreases the pointer, or returns null.

Returns:
previous string

next

public byte[] next()
Returns the next string and increases the pointer, or returns null.

Returns:
previous string

cursor

public int cursor()
Returns the cursor position.

Returns:
cursor position

store

public void store(byte[] str,
                  int oc,
                  int nc)
Stores a string in the history.

Parameters:
str - string to be stored
oc - old cursor position
nc - new cursor position

save

public void save()
Sets the saved position.


modified

public boolean modified()
Checks if the file has been modified.

Returns:
result of check