nl.toolforge.karma.cli
Class HistoryManager

java.lang.Object
  extended bynl.toolforge.karma.cli.HistoryManager

public final class HistoryManager
extends java.lang.Object

Class managing the CLI history of commands that have been run. The CLI is capable of fetching arrow-up and arrow-down commands

Version:
$Id: HistoryManager.java,v 1.3 2004/11/02 23:57:05 asmedes Exp $
Author:
D.A. Smedes

Constructor Summary
HistoryManager(int maxHistoryItems)
           
 
Method Summary
 void addHistoryItem(java.lang.String commandLine)
          Adds a command line string to the history.
 java.lang.String getCurrentHistoryItem()
          Returns the current history item that is been pointed at.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HistoryManager

public HistoryManager(int maxHistoryItems)
Method Detail

addHistoryItem

public void addHistoryItem(java.lang.String commandLine)
Adds a command line string to the history. The current history

Parameters:
commandLine - The string that is fetched from stdin.

getCurrentHistoryItem

public java.lang.String getCurrentHistoryItem()
Returns the current history item that is been pointed at. The history maintains a pointer to the last selected item, and returns that one.

Returns:
A command line item as a string or an empty string when no history items were available.


Copyright © 2004-2006 Sourceforge. All Rights Reserved.