org.freehep.jas.plugin.console
Class ConsoleInputStream

java.lang.Object
  extended by java.io.InputStream
      extended by org.freehep.jas.plugin.console.ConsoleInputStream
All Implemented Interfaces:
Closeable

public abstract class ConsoleInputStream
extends InputStream

An InputStream for reading input typed into a console.

Version:
$Id: ConsoleInputStream.java 14068 2012-12-04 00:32:28Z tonyj $
Author:
tonyj

Constructor Summary
ConsoleInputStream()
           
 
Method Summary
 String getPrompt()
          Get the current (permanent) prompt.
 void setInitialEntry(String entry)
          The initial entry is prefilled into the input area following the prompt.
 void setOneTimePrompt(String prompt)
          Sets the prompt.
 void setPrompt(String prompt)
          Sets the prompt.
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsoleInputStream

public ConsoleInputStream()
Method Detail

setPrompt

public void setPrompt(String prompt)
Sets the prompt. The prompt will be displayed in the console when input is needed from the user.

Parameters:
prompt - The prompt string

setOneTimePrompt

public void setOneTimePrompt(String prompt)
Sets the prompt. The new prompt will be used only once and then the default prompt will be restored.

Parameters:
prompt - The prompt string

getPrompt

public String getPrompt()
Get the current (permanent) prompt.

Returns:
The prompt string

setInitialEntry

public void setInitialEntry(String entry)
The initial entry is prefilled into the input area following the prompt. Unlike the prompt it can be cleared by the user (using backspace for example). The initial entry is used only for a single prompt, and is then cleared.

Parameters:
entry - The string to pre fill the input area.


Copyright © 2013. All Rights Reserved.