org.quattor.pan.dml.operators
Class SetValue

java.lang.Object
  extended by org.quattor.pan.dml.AbstractOperation
      extended by org.quattor.pan.dml.operators.SetValue
All Implemented Interfaces:
Operation
Direct Known Subclasses:
SetSelf

public class SetValue
extends AbstractOperation

Implements a special operation to allow a result to be assigned to a variable. This is generated by the compiler, but is not explicitly visible in the pan language.

Author:
loomis

Field Summary
protected  java.lang.String identifier
           
 
Fields inherited from class org.quattor.pan.dml.AbstractOperation
ops, sourceRange
 
Constructor Summary
protected SetValue(SourceRange sourceRange, java.lang.String identifier, Operation... operations)
           
 
Method Summary
protected static void checkStaticIndexes(SourceRange sourceRange, Operation... operations)
           
 Element execute(Context context)
          Execute this operation within the given context.
 Element execute(Context context, Element result)
           
static SetValue getInstance(SourceRange sourceRange, java.lang.String identifier, Operation... operations)
           
static SetValue getInstance(Variable v)
           
 java.lang.String toString()
          Default string representation of an operation is the class' simple name.
protected  void validName(java.lang.String name)
          A utility method to determine if the variable name collides with one of the reserved 'automatic' variables.
 
Methods inherited from class org.quattor.pan.dml.AbstractOperation
calculateArgs, calculateTerms, checkInvalidSelfContext, checkRestrictedContext, getOperations, getSourceRange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

identifier

protected java.lang.String identifier
Constructor Detail

SetValue

protected SetValue(SourceRange sourceRange,
                   java.lang.String identifier,
                   Operation... operations)
            throws SyntaxException
Throws:
SyntaxException
Method Detail

checkStaticIndexes

protected static void checkStaticIndexes(SourceRange sourceRange,
                                         Operation... operations)
                                  throws SyntaxException
Throws:
SyntaxException

validName

protected void validName(java.lang.String name)
                  throws SyntaxException
A utility method to determine if the variable name collides with one of the reserved 'automatic' variables.

Parameters:
name - variable name to check
Throws:
SyntaxException

getInstance

public static SetValue getInstance(SourceRange sourceRange,
                                   java.lang.String identifier,
                                   Operation... operations)
                            throws SyntaxException
Throws:
SyntaxException

getInstance

public static SetValue getInstance(Variable v)
                            throws SyntaxException
Throws:
SyntaxException

execute

public Element execute(Context context)
Description copied from interface: Operation
Execute this operation within the given context. If an error occurs, an EvaluationException will be thrown with the details.

Specified by:
execute in interface Operation
Specified by:
execute in class AbstractOperation
Parameters:
context - evaluation context for the statement
Returns:
Element produced by running operation

execute

public Element execute(Context context,
                       Element result)

toString

public java.lang.String toString()
Description copied from class: AbstractOperation
Default string representation of an operation is the class' simple name.

Overrides:
toString in class AbstractOperation
Returns:
string of class' simple name


Copyright © 2011 Quattor. All Rights Reserved.