yakscript
Class YakScript

java.lang.Object
  |
  +--yakscript.YakScript

public class YakScript
extends java.lang.Object

A YakScript interpreter


Field Summary
 java.util.Properties config
          Configuration properties
 boolean debug
           
 DisplayInterface display
          Instance of DisplayInterface for callbacks
 java.util.Hashtable f
          Hashtable of all Frames in currently loaded script ##TODO## should not be public
static double YAKSCRIPT_VERSION
          Version of YakScript implemented (will refuse to run scripts denoted with higher versions)
 
Constructor Summary
YakScript()
           
 
Method Summary
 void doAction(java.lang.String _key)
          Act on key
 void doInitAction()
          Perform initial action
 boolean doTrigger(java.lang.String key)
          Act on trigger event
 void execAction(java.lang.String key)
           
 java.util.Vector getKeys()
          Get keys for the current frame (filter out all keys starting with "_" and performing variable substitution first)
 java.util.Stack getStack()
          Return the script's entire frame stack
 FrameState getState()
          Return the script's current FrameState
 java.lang.String getTitle()
          Get the title for the current frame
 boolean load(java.lang.String name)
          Load in a script and prepare it for use
 void printError(java.lang.String e)
           
static void printWarning(java.lang.String e, java.lang.String key, java.lang.String frame)
           
 void register(DisplayInterface _display, java.lang.String[] args)
          Register a Display for use and configure YakScript instance
 void start()
          Start executing script contents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

YAKSCRIPT_VERSION

public static double YAKSCRIPT_VERSION
Version of YakScript implemented (will refuse to run scripts denoted with higher versions)

f

public java.util.Hashtable f
Hashtable of all Frames in currently loaded script ##TODO## should not be public

display

public DisplayInterface display
Instance of DisplayInterface for callbacks

config

public java.util.Properties config
Configuration properties

debug

public boolean debug
Constructor Detail

YakScript

public YakScript()
Method Detail

register

public void register(DisplayInterface _display,
                     java.lang.String[] args)
Register a Display for use and configure YakScript instance
Parameters:
_display - Implementation of DisplayInterface for callbacks
args - Arguments to be interpreted

load

public boolean load(java.lang.String name)
Load in a script and prepare it for use
Parameters:
name - Filename of script to load
Returns:
true if loaded successfully

start

public void start()
Start executing script contents

execAction

public void execAction(java.lang.String key)

doAction

public void doAction(java.lang.String _key)
Act on key
Parameters:
key - Selected key
Returns:
true if action resulted in a frame change

getStack

public java.util.Stack getStack()
Return the script's entire frame stack
Returns:
Stack of FrameStates

getState

public FrameState getState()
Return the script's current FrameState
Returns:
Reference to current FrameState

getTitle

public java.lang.String getTitle()
Get the title for the current frame
Returns:
Text string or null if not found

getKeys

public java.util.Vector getKeys()
Get keys for the current frame (filter out all keys starting with "_" and performing variable substitution first)
Returns:
Vector of all keys in current frame in format key 1 raw, key 1 formatted, key 2 raw, ...

doTrigger

public boolean doTrigger(java.lang.String key)
Act on trigger event
Parameters:
key - Trigger key string
Returns:
false if trigger inactive or not found

doInitAction

public void doInitAction()
Perform initial action

printWarning

public static void printWarning(java.lang.String e,
                                java.lang.String key,
                                java.lang.String frame)

printError

public void printError(java.lang.String e)