com.neeve.robin
Class Script

java.lang.Object
  extended by com.neeve.robin.Script

public final class Script
extends Object

Represents an executable Robin script


Method Summary
 void abort()
          Abort a script execution
 boolean aborted()
          Indicates whether the abort flag is set
 void cleanup()
          Cleanup all scripts commands in reverse order
 void clear()
          Clear a script's command set
 List<Command> commands()
          Get the script instruction set
 int current()
          Get the current instruction pointer
 String getRunId()
          Gets the run id currently set for the script.
 Script parseCommandLine(String line, int lineNum, boolean mock)
          Parse a command string
 Script parseFromFile(String scriptFilename)
          Parse commands from a script file This method invokes parseFromFile(scriptFilename, null)
 Script parseFromFile(String scriptFilename, String commaDelimitedKeyValuePairs)
          Parse a script file using parameters specified as a comma delimited string of key value pairs
 Script parseFromFile(String scriptFilename, com.neeve.util.UtlTailoring.PropertySource primaryParameterResolver)
          Parse a script file using a specified parameter resolver
 void rewind()
          Rewind the script's current pointer back to the beginning
 void run()
          Run all commands from current to end of the script.
 void run(int numCommands)
          Run a specified number of commands in a script with a new run calculated from the given time
 void truncate(int pos)
          Truncate a script's command set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

commands

public final List<Command> commands()
Get the script instruction set


current

public final int current()
Get the current instruction pointer


rewind

public final void rewind()
Rewind the script's current pointer back to the beginning


clear

public final void clear()
Clear a script's command set


truncate

public final void truncate(int pos)
Truncate a script's command set


parseCommandLine

public final Script parseCommandLine(String line,
                                     int lineNum,
                                     boolean mock)
Parse a command string


parseFromFile

public final Script parseFromFile(String scriptFilename,
                                  com.neeve.util.UtlTailoring.PropertySource primaryParameterResolver)
Parse a script file using a specified parameter resolver


parseFromFile

public final Script parseFromFile(String scriptFilename,
                                  String commaDelimitedKeyValuePairs)
                           throws IOException
Parse a script file using parameters specified as a comma delimited string of key value pairs

Throws:
IOException

parseFromFile

public final Script parseFromFile(String scriptFilename)
Parse commands from a script file

This method invokes parseFromFile(scriptFilename, null)


run

public final void run(int numCommands)
Run a specified number of commands in a script with a new run calculated from the given time

Parameters:
numCommands - The number of commands to run. A value of -1 indicates all commands from the current command to the end of the script.

This method runs a specified number of commands starting from the script's current command.


run

public final void run()
Run all commands from current to end of the script.

This method is equivalent to invoking run(-1) current command.


abort

public final void abort()
Abort a script execution


aborted

public final boolean aborted()
Indicates whether the abort flag is set


cleanup

public final void cleanup()
Cleanup all scripts commands in reverse order


getRunId

public String getRunId()
Gets the run id currently set for the script. The run id is used to create run specific path and output files. It is updated each time a script is parsed.

Returns:
The current run id associated with this script.


Copyright © 2016 Neeve Research, LLC. All Rights Reserved.