Package org.jmol.util
Class CommandHistory
java.lang.Object
org.jmol.util.CommandHistory
Implements a queue for a bash-like command history.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommand
(String strCommand) Adds any number of lines to the command historyvoid
clear()
clears the history.Retrieves the following command from the top of the list, updates list position.Retrieves the following command from the bottom of the list, updates list position.getSetHistory
(int n) Options include: all Integer.MAX_VALUE n prev n >= 1 next -1 set max to -2 - n n invalid input: '<'= -3 just clear -2 clear and turn off; return "" 0 clear and turn on; return "" Integer.MIN_VALUE;popState()
void
removeCommand
(int n) void
reset
(int maxSize) Resets instance.void
setMaxSize
(int maxSize) Resets maximum size of command queue.
-
Field Details
-
ERROR_FLAG
- See Also:
-
NOHISTORYLINE_FLAG
- See Also:
-
NOHISTORYATALL_FLAG
- See Also:
-
-
Constructor Details
-
CommandHistory
public CommandHistory()Creates a new instance using the default size (100)
-
-
Method Details
-
clear
public void clear()clears the history. -
reset
public void reset(int maxSize) Resets instance.- Parameters:
maxSize
- maximum size for the command queue.
-
setMaxSize
public void setMaxSize(int maxSize) Resets maximum size of command queue. Cuts off extra commands.- Parameters:
maxSize
- maximum size for the command queue.
-
getCommandUp
Retrieves the following command from the bottom of the list, updates list position.- Returns:
- the String value of a command.
-
getCommandDown
Retrieves the following command from the top of the list, updates list position.- Returns:
- the String value of a command.
-
addCommand
Adds any number of lines to the command history- Parameters:
strCommand
-
-
getSetHistory
Options include: all Integer.MAX_VALUE n prev n >= 1 next -1 set max to -2 - n n invalid input: '<'= -3 just clear -2 clear and turn off; return "" 0 clear and turn on; return "" Integer.MIN_VALUE;- Parameters:
n
-- Returns:
- one or more lines of command history
-
find
-
removeCommand
-
removeCommand
-
pushState
-
popState
-