|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjfun.jaskell.shell.ShellImpl
public class ShellImpl
Implementation of shell functionality parameterized with Jaskell runtime so that this can be used for any different runtime configuration.
Constructor Summary | |
---|---|
ShellImpl()
To create a ShellImpl object. |
|
ShellImpl(Jaskell runtime,
java.lang.String greeting)
To create a ShellImpl object. |
Method Summary | |
---|---|
java.lang.String |
getGreeting()
Get the greeting text. |
Jaskell |
getRuntime()
Get the Jaskell runtime used to evaluate expressions. |
protected java.lang.Object |
getUserVariable(java.lang.String name)
Get the value of a user defined variable. |
protected int |
getUserVariableCount()
To get the number of variables defined by user. |
protected java.lang.String[] |
getUserVariableNames()
Get the user variable names. |
protected boolean |
hasUserVariable(java.lang.String name)
To determine if a certain variable is defined by user. |
void |
interaction()
Interpret commands and expressions interactively. |
protected void |
onExit()
called when the shell exits. |
protected void |
onStartup()
Called when the shell starts up. |
void |
runShell(java.lang.String[] args)
Run the shell using an array of command line arguments. |
void |
setGreeting(java.lang.String greeting)
To set the greeting message. |
void |
setRuntime(Jaskell runtime)
To set the Jaskell runtime used by the shell. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ShellImpl(Jaskell runtime, java.lang.String greeting)
runtime
- the Jaskell runtime object.greeting
- the greeting message when shell starts up.public ShellImpl()
setRuntime(Jaskell)
will need to be called before the shell is started up.
Method Detail |
---|
public void runShell(java.lang.String[] args)
If one argument is provided, it is treated as a file name and the file is interpreted, otherwise, commands are interpreted interactively/
args
- the command line arguments.protected java.lang.Object getUserVariable(java.lang.String name)
name
- the variable name.
protected boolean hasUserVariable(java.lang.String name)
name
- the variable name.
protected int getUserVariableCount()
protected java.lang.String[] getUserVariableNames()
public void interaction()
public java.lang.String getGreeting()
public Jaskell getRuntime()
public void setRuntime(Jaskell runtime)
runtime
- the jaskell runtime to use.public void setGreeting(java.lang.String greeting)
greeting
- the greeting message.protected void onExit()
protected void onStartup()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |