net.sourceforge.nrl.parser.ast.constraints.impl
Class GlobalExistsStatementImpl

java.lang.Object
  extended by org.antlr.runtime.tree.BaseTree
      extended by org.antlr.runtime.tree.CommonTree
          extended by net.sourceforge.nrl.parser.ast.impl.Antlr3NRLBaseAst
              extended by net.sourceforge.nrl.parser.ast.constraints.impl.ConstraintImpl
                  extended by net.sourceforge.nrl.parser.ast.constraints.impl.GlobalExistsStatementImpl
All Implemented Interfaces:
IConstraint, IGlobalExistsStatement, INRLAstNode, org.antlr.runtime.tree.Tree

public class GlobalExistsStatementImpl
extends ConstraintImpl
implements IGlobalExistsStatement


Field Summary
 
Fields inherited from class org.antlr.runtime.tree.CommonTree
childIndex, parent, startIndex, stopIndex, token
 
Fields inherited from class org.antlr.runtime.tree.BaseTree
children
 
Fields inherited from interface net.sourceforge.nrl.parser.ast.INRLAstNode
NEWLINE
 
Fields inherited from interface org.antlr.runtime.tree.Tree
INVALID_NODE
 
Constructor Summary
GlobalExistsStatementImpl()
           
GlobalExistsStatementImpl(org.antlr.runtime.Token token)
           
 
Method Summary
 void accept(INRLAstVisitor visitor)
          Accept a visitor to this node.
 String dump(int indent)
          Deprecated. 
 IConstraint getConstraint()
          Return the constraint to check relative to the object being iterated over.
 int getCount()
          Return the cardinality constraint if there is one.
 IModelElement getElement()
          Return the model element being checked for existence.
 String getElementName()
           
 IModelReference getModelReference()
           
 IVariable getVariable()
          If the statement is used to check for the existence (rather than absence) of an element, the element can be assigned to a variable if found.
 String getVariableName()
           
 boolean hasConstraint()
          Return true if there is a constraint attached that is to be executed relative to the model element.
 void setModelElement(IModelElement element)
           
 void setVariable(IVariable variable)
           
 
Methods inherited from class net.sourceforge.nrl.parser.ast.constraints.impl.ConstraintImpl
getNRLDataType, setNRLDataType
 
Methods inherited from class net.sourceforge.nrl.parser.ast.impl.Antlr3NRLBaseAst
doIndent, getColumn, getLine, getUserData, initialisePositionFromChild, setColumn, setLine, setUserData
 
Methods inherited from class org.antlr.runtime.tree.CommonTree
dupNode, getCharPositionInLine, getChildIndex, getParent, getText, getToken, getTokenStartIndex, getTokenStopIndex, getType, isNil, setChildIndex, setParent, setTokenStartIndex, setTokenStopIndex, setUnknownTokenBoundaries, toString
 
Methods inherited from class org.antlr.runtime.tree.BaseTree
addChild, addChildren, createChildrenList, deleteChild, freshenParentAndChildIndexes, freshenParentAndChildIndexes, getAncestor, getAncestors, getChild, getChildCount, getChildren, getFirstChildWithType, hasAncestor, replaceChildren, sanityCheckParentAndChildIndexes, sanityCheckParentAndChildIndexes, setChild, toStringTree
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface net.sourceforge.nrl.parser.ast.constraints.IConstraint
getNRLDataType, setNRLDataType
 
Methods inherited from interface net.sourceforge.nrl.parser.ast.INRLAstNode
getColumn, getLine, getUserData, setUserData
 

Constructor Detail

GlobalExistsStatementImpl

public GlobalExistsStatementImpl()

GlobalExistsStatementImpl

public GlobalExistsStatementImpl(org.antlr.runtime.Token token)
Method Detail

accept

public void accept(INRLAstVisitor visitor)
Description copied from interface: INRLAstNode
Accept a visitor to this node.

Specified by:
accept in interface INRLAstNode
Overrides:
accept in class Antlr3NRLBaseAst
Parameters:
visitor - the visitor

dump

@Deprecated
public String dump(int indent)
Deprecated. 

Description copied from interface: INRLAstNode
Dump the AST and its children for debugging purposes

Specified by:
dump in interface INRLAstNode
Overrides:
dump in class Antlr3NRLBaseAst
Parameters:
indent - the indentation count, 0 on first call
Returns:
the AST as a string

getConstraint

public IConstraint getConstraint()
Description copied from interface: IGlobalExistsStatement
Return the constraint to check relative to the object being iterated over. Use IGlobalExistsStatement.hasConstraint() to check if it exists first.

Specified by:
getConstraint in interface IGlobalExistsStatement
Returns:
the constraint or null

getCount

public int getCount()
Description copied from interface: IGlobalExistsStatement
Return the cardinality constraint if there is one. This will always return one or zero for the time being, zero indicating 'none'.

It never returns null.

Specified by:
getCount in interface IGlobalExistsStatement
Returns:
the cardinality constraint, as a number

getElement

public IModelElement getElement()
Description copied from interface: IGlobalExistsStatement
Return the model element being checked for existence. Never returns null.

Specified by:
getElement in interface IGlobalExistsStatement
Returns:
the model element

getVariable

public IVariable getVariable()
Description copied from interface: IGlobalExistsStatement
If the statement is used to check for the existence (rather than absence) of an element, the element can be assigned to a variable if found. If a variable is assigned, it is returned here.

Specified by:
getVariable in interface IGlobalExistsStatement
Returns:
the variable or null if none was assigned

getVariableName

public String getVariableName()

hasConstraint

public boolean hasConstraint()
Description copied from interface: IGlobalExistsStatement
Return true if there is a constraint attached that is to be executed relative to the model element.

Specified by:
hasConstraint in interface IGlobalExistsStatement
Returns:
true if a constraint is attached

getModelReference

public IModelReference getModelReference()

getElementName

public String getElementName()

setModelElement

public void setModelElement(IModelElement element)

setVariable

public void setVariable(IVariable variable)


Copyright © 2006-2013. All Rights Reserved.