org.jext.dawn
Class CodeSnippet

java.lang.Object
  extended byorg.jext.dawn.CodeSnippet
Direct Known Subclasses:
DupDupFunction, InvertFunction, NegFunction, RotFunction, SameTypeFunction, TokenizeArrayFunction, UnrotFunction

public abstract class CodeSnippet
extends java.lang.Object

The CodeSnippet class stands for an interface for Dawn code snippets. A code snippet is a mini-script written in Dawn which will be used by DawnParser to create a function. Code snippets avoid writting annoying Java source code which can generate errors and be a pain to debug.

Author:
Romain Guy

Constructor Summary
CodeSnippet()
           
 
Method Summary
abstract  java.lang.String getCode()
          Returns the function code.
 java.lang.String getHelp()
          Returns the contexive help associated with this function.
abstract  java.lang.String getName()
          Returns the function name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CodeSnippet

public CodeSnippet()
Method Detail

getName

public abstract java.lang.String getName()
Returns the function name. The returned name is the name which must be called in a script to invoke the function.

Returns:
A String, containing the name

getHelp

public java.lang.String getHelp()
Returns the contexive help associated with this function.


getCode

public abstract java.lang.String getCode()
Returns the function code. This code must be written in Dawn scripting language. A code snippet can contains any Dawn function and also use the 'needs' keyword to request the installation of a specific package.

Returns:
A String, containing the code


Copyright © 2002 Romain Guy.