org.quattor.pan.statement
Class FunctionStatement

java.lang.Object
  extended by org.quattor.pan.statement.Statement
      extended by org.quattor.pan.statement.FunctionStatement

public class FunctionStatement
extends Statement

Associates a DML block to a given function name. A function may only be defined once during the construction of any given machine profile.

Author:
loomis

Constructor Summary
FunctionStatement(SourceRange sourceRange, java.lang.String name, Operation function)
          Creates a FunctionStatement which associates a name with a given DML block.
 
Method Summary
 void execute(Context context)
          Execute this Statement within the given context.
 java.lang.String getName()
          Retrieve the name of the defined function.
 java.lang.String toString()
          Return a reasonable string representation of this statement.
 
Methods inherited from class org.quattor.pan.statement.Statement
getSourceRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FunctionStatement

public FunctionStatement(SourceRange sourceRange,
                         java.lang.String name,
                         Operation function)
Creates a FunctionStatement which associates a name with a given DML block.

Parameters:
sourceRange - source location of this statement
name - name of the function
function - DML block for the function
Method Detail

getName

public java.lang.String getName()
Retrieve the name of the defined function. This information is used by Template for compile-time error checking.

Returns:
name of the defined function

execute

public void execute(Context context)
Description copied from class: Statement
Execute this Statement within the given context.

Specified by:
execute in class Statement
Parameters:
context - DML context to use for the evalution of this statement

toString

public java.lang.String toString()
Return a reasonable string representation of this statement.

Overrides:
toString in class java.lang.Object
Returns:
String representation of this FunctionStatement


Copyright © 2011 Quattor. All Rights Reserved.