org.hawk.module.script
Class VariableDeclScript

java.lang.Object
  extended by org.hawk.module.script.AbstractScript
      extended by org.hawk.module.script.SingleLineScript
          extended by org.hawk.module.script.VariableDeclScript
All Implemented Interfaces:
IScript
Direct Known Subclasses:
LocalVarDeclScript

public class VariableDeclScript
extends SingleLineScript


Field Summary
protected  java.lang.String OrigVariableValExp
           
protected  java.lang.String vaiableValExp
           
protected  Variable variable
           
protected static java.util.regex.Pattern VARIABLE_PATTERN
           
protected  Variable variableValue
           
 
Fields inherited from class org.hawk.module.script.AbstractScript
outerMultiLineScript
 
Constructor Summary
VariableDeclScript()
           
 
Method Summary
 IScript add(IScript otherScript)
           
 IScript assign(IScript otherScript)
           
 IScript copy()
           
static VariableDeclScript createScript(java.util.Map<java.lang.Integer,java.lang.String> lineVariableDeclMatcherMap)
           
 IScript divide(IScript otherScript)
           
 IScript equalTo(IScript otherScript)
           
 Variable execute()
          This executes the contents of a script.
 java.lang.String getOrigVariableValExp()
           
static java.util.regex.Pattern getPattern()
           
 Variable getVariable()
           
 java.lang.String getVariableValExp()
           
 Variable getVariableValue()
           
 IScript greaterThan(IScript otherScript)
           
 IScript greaterThanEqualTo(IScript otherScript)
           
 boolean isVariable()
           
 IScript lessThan(IScript otherScript)
           
 IScript lessThanEqualTo(IScript otherScript)
           
 java.lang.String mangle()
           
 IScript modulus(IScript otherScript)
           
 IScript multiply(IScript otherScript)
           
 void setOrigVariableValExp(java.lang.String OrigVariableValExp)
           
 void setVariable(Variable var)
           
 void setVariableValExp(java.lang.String variableValExp)
           
 void setVariableValue(Variable variableValue)
           
 IScript subtract(IScript otherScript)
           
 java.lang.Object toJava()
          This converts the hawk object into java object
 java.util.Map<java.lang.Object,java.lang.Object> toJavaMap()
          This converts the hawk object into java map..
 java.lang.String toUI()
           
 
Methods inherited from class org.hawk.module.script.SingleLineScript
addScripts, findNearestOuterMLScript
 
Methods inherited from class org.hawk.module.script.AbstractScript
and, arrayBracket, evaluateGlobalVariable, evaluateLocalBoolean, evaluateLocalVariable, getLineNumber, getOuterMultiLineScript, isLastScript, or, popLocalVars, pushLocalVars, refer, setLastScript, setLineNumber, setOuterMultiLineScript
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VARIABLE_PATTERN

protected static final java.util.regex.Pattern VARIABLE_PATTERN

variable

protected Variable variable

vaiableValExp

protected java.lang.String vaiableValExp

OrigVariableValExp

protected java.lang.String OrigVariableValExp

variableValue

protected Variable variableValue
Constructor Detail

VariableDeclScript

public VariableDeclScript()
Method Detail

getOrigVariableValExp

public java.lang.String getOrigVariableValExp()

setOrigVariableValExp

public void setOrigVariableValExp(java.lang.String OrigVariableValExp)

getVariableValExp

public java.lang.String getVariableValExp()

setVariableValExp

public void setVariableValExp(java.lang.String variableValExp)

setVariable

public void setVariable(Variable var)
Specified by:
setVariable in interface IScript
Overrides:
setVariable in class SingleLineScript

setVariableValue

public void setVariableValue(Variable variableValue)
Specified by:
setVariableValue in interface IScript
Overrides:
setVariableValue in class SingleLineScript

getVariable

public Variable getVariable()
Specified by:
getVariable in interface IScript
Overrides:
getVariable in class SingleLineScript

getVariableValue

public Variable getVariableValue()
Specified by:
getVariableValue in interface IScript
Overrides:
getVariableValue in class SingleLineScript

getPattern

public static java.util.regex.Pattern getPattern()

execute

public Variable execute()
                 throws HawkException
Description copied from interface: IScript
This executes the contents of a script. This returns either a boolean or double depending upon how a method is invoked.

Specified by:
execute in interface IScript
Overrides:
execute in class SingleLineScript
Returns:
the returned data is being used to test whether a function returns or not. Currently Hawk support two types return Double and Boolean.The implementation should look at the return type and script type to determine what action to be taken.
Throws:
HawkException

createScript

public static VariableDeclScript createScript(java.util.Map<java.lang.Integer,java.lang.String> lineVariableDeclMatcherMap)

isVariable

public boolean isVariable()
Specified by:
isVariable in interface IScript
Overrides:
isVariable in class SingleLineScript
Returns:

add

public IScript add(IScript otherScript)
            throws HawkException
Specified by:
add in interface IScript
Overrides:
add in class AbstractScript
Throws:
HawkException

divide

public IScript divide(IScript otherScript)
               throws HawkException
Specified by:
divide in interface IScript
Overrides:
divide in class AbstractScript
Throws:
HawkException

equalTo

public IScript equalTo(IScript otherScript)
                throws HawkException
Specified by:
equalTo in interface IScript
Overrides:
equalTo in class AbstractScript
Throws:
HawkException

greaterThan

public IScript greaterThan(IScript otherScript)
                    throws HawkException
Specified by:
greaterThan in interface IScript
Overrides:
greaterThan in class AbstractScript
Throws:
HawkException

greaterThanEqualTo

public IScript greaterThanEqualTo(IScript otherScript)
                           throws HawkException
Specified by:
greaterThanEqualTo in interface IScript
Overrides:
greaterThanEqualTo in class AbstractScript
Throws:
HawkException

lessThan

public IScript lessThan(IScript otherScript)
                 throws HawkException
Specified by:
lessThan in interface IScript
Overrides:
lessThan in class AbstractScript
Throws:
HawkException

lessThanEqualTo

public IScript lessThanEqualTo(IScript otherScript)
                        throws HawkException
Specified by:
lessThanEqualTo in interface IScript
Overrides:
lessThanEqualTo in class AbstractScript
Throws:
HawkException

modulus

public IScript modulus(IScript otherScript)
                throws HawkException
Specified by:
modulus in interface IScript
Overrides:
modulus in class AbstractScript
Throws:
HawkException

multiply

public IScript multiply(IScript otherScript)
                 throws HawkException
Specified by:
multiply in interface IScript
Overrides:
multiply in class AbstractScript
Throws:
HawkException

subtract

public IScript subtract(IScript otherScript)
                 throws HawkException
Specified by:
subtract in interface IScript
Overrides:
subtract in class AbstractScript
Throws:
HawkException

assign

public IScript assign(IScript otherScript)
               throws HawkException
Specified by:
assign in interface IScript
Overrides:
assign in class AbstractScript
Throws:
HawkException

toUI

public java.lang.String toUI()
Specified by:
toUI in interface IScript
Overrides:
toUI in class SingleLineScript

toJavaMap

public java.util.Map<java.lang.Object,java.lang.Object> toJavaMap()
                                                           throws HawkException
Description copied from interface: IScript
This converts the hawk object into java map..

Specified by:
toJavaMap in interface IScript
Overrides:
toJavaMap in class AbstractScript
Returns:
Throws:
HawkException

toJava

public java.lang.Object toJava()
                        throws HawkException
Description copied from interface: IScript
This converts the hawk object into java object

Specified by:
toJava in interface IScript
Overrides:
toJava in class AbstractScript
Returns:
Throws:
HawkException

copy

public IScript copy()
Specified by:
copy in interface IScript
Overrides:
copy in class SingleLineScript

mangle

public java.lang.String mangle()
Specified by:
mangle in interface IScript
Overrides:
mangle in class AbstractScript