com.soundhelix.remotecontrol
Class ConsoleRemoteControl
java.lang.Object
com.soundhelix.remotecontrol.AbstractTextRemoteControl
com.soundhelix.remotecontrol.ConsoleRemoteControl
- All Implemented Interfaces:
- RemoteControl, TextRemoteControl, Runnable
public class ConsoleRemoteControl
- extends AbstractTextRemoteControl
Implements a remote control that uses the console.
- Author:
- Thomas Schuerger (thomas@schuerger.com)
|
Method Summary |
String |
readLine()
Returns the next line entered by the user. |
void |
writeLine(String line)
Writes a line to the output that is to made visible to the user. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConsoleRemoteControl
public ConsoleRemoteControl()
- Constructor.
readLine
public String readLine()
- Description copied from interface:
TextRemoteControl
- Returns the next line entered by the user. This method is allowed to block until input is available, or it can return null if there is no
input. The returned string must contain the net line content only (without any line separator(s) at the end).
- Returns:
- the user input string or null if none is available
writeLine
public void writeLine(String line)
- Description copied from interface:
TextRemoteControl
- Writes a line to the output that is to made visible to the user. The string should not contain CR or CR and LF at the end.
- Parameters:
line - the string to write