Class GroovyScript

java.lang.Object
weka.gui.scripting.Script
weka.gui.scripting.GroovyScript
All Implemented Interfaces:
Serializable, OptionHandler

public class GroovyScript extends Script
Represents a Groovy script.
Version:
$Revision: 8034 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
  • Constructor Details

    • GroovyScript

      public GroovyScript()
      Initializes the script.
    • GroovyScript

      public GroovyScript(Document doc)
      Initializes the script.
      Parameters:
      doc - the document to use as basis
    • GroovyScript

      public GroovyScript(Document doc, File file)
      Initializes the script. Automatically loads the specified file, if not null.
      Parameters:
      doc - the document to use as basis
      file - the file to load (if not null)
  • Method Details

    • getFilters

      public ExtensionFileFilter[] getFilters()
      Returns the extension filters for this type of script.
      Specified by:
      getFilters in class Script
      Returns:
      the filters
    • getDefaultExtension

      public String getDefaultExtension()
      Returns the default extension. Gets automatically added to files if their name doesn't end with this.
      Specified by:
      getDefaultExtension in class Script
      Returns:
      the default extension (incl. the dot)
      See Also:
    • newThread

      public Script.ScriptThread newThread(String[] args)
      Returns a new thread to execute.
      Specified by:
      newThread in class Script
      Parameters:
      args - optional commandline arguments
      Returns:
      the new thread object
    • main

      public static void main(String[] args) throws Exception
      Runs the script from commandline. Use "-h" to list all options.
      Parameters:
      args - the commandline arguments
      Throws:
      Exception - if execution fails