Class CommandUI

java.lang.Object
extended by CommandUI
All Implemented Interfaces:
java.lang.Runnable

public abstract class CommandUI
extends java.lang.Object
implements java.lang.Runnable

an extensible, dynamic command line interface.

when extending, provide functions with signature:
x y _z(String ... args);
OR
x y _z(String arg);
where x = any accessibility modifier (private recommended) y = any return type (void recommended, nothing will be returned regardless) z = function name to call on the command line

Author:
xxx

Nested Class Summary
protected static class CommandUI.InternalException
          thrown for internal, non-breaking errors
 
Constructor Summary
CommandUI()
          default constructor
PROMPT is initialized to "%"
CommandUI(java.lang.String prompt)
           
CommandUI(java.lang.String prompt, java.lang.String function)
           
 
Method Summary
 void quit()
          halts execution before next input
 void run()
          primary execution method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommandUI

public CommandUI()
default constructor
PROMPT is initialized to "%"


CommandUI

public CommandUI(java.lang.String prompt)
Parameters:
prompt - input prompt

CommandUI

public CommandUI(java.lang.String prompt,
java.lang.String function)
Parameters:
prompt - input prompt
function - default function to invoke
Method Detail

quit

public void quit()
halts execution before next input


run

public void run()
primary execution method

Specified by:
run in interface java.lang.Runnable