net.sourceforge.nrl.parser.ast.constraints
Interface IGlobalExistsStatement

All Superinterfaces:
IConstraint, INRLAstNode

public interface IGlobalExistsStatement
extends IConstraint

A "global" exists statement. This tests for the existence or absence of an object - rather than of an attribute or a member of a collection, like the exists statement.

Abstract syntax reference: thereIs ("no")? element:ModelReference (Variable)? (constraint:Constraint)?


Field Summary
 
Fields inherited from interface net.sourceforge.nrl.parser.ast.INRLAstNode
NEWLINE
 
Method Summary
 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.
 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.
 boolean hasConstraint()
          Return true if there is a constraint attached that is to be executed relative to the model element.
 
Methods inherited from interface net.sourceforge.nrl.parser.ast.constraints.IConstraint
getNRLDataType, setNRLDataType
 
Methods inherited from interface net.sourceforge.nrl.parser.ast.INRLAstNode
accept, dump, getColumn, getLine, getUserData, setUserData
 

Method Detail

getConstraint

IConstraint getConstraint()
Return the constraint to check relative to the object being iterated over. Use hasConstraint() to check if it exists first.

Returns:
the constraint or null

getCount

int getCount()
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.

Returns:
the cardinality constraint, as a number

getElement

IModelElement getElement()
Return the model element being checked for existence. Never returns null.

Returns:
the model element

getVariable

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. If a variable is assigned, it is returned here.

Returns:
the variable or null if none was assigned

hasConstraint

boolean hasConstraint()
Return true if there is a constraint attached that is to be executed relative to the model element.

Returns:
true if a constraint is attached


Copyright © 2006-2010 Christian Nentwich and others