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

All Superinterfaces:
IConstraint, INRLAstNode

public interface IExistsStatement
extends IConstraint

One of the "exists" statements. Expresses that an element in a collection exists, or that a simple attribute exists. The statement contains an optional "cardinality constraint", which declares how many elements exist in a collection, and an optional "constraint", which specifies a constraint that has to hold for each element in the collection that is checked for existence.

Abstract syntax reference: exists (count:CardinalityConstraint)? element:ModelReference (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 each collection member being iterated over.
 ICardinalityConstraint getCount()
          Return the cardinality constraint (one, two, three, at least one, etc.), if there is one.
 IModelReference getElement()
          Return the model reference being checked for existence.
 boolean hasConstraint()
          Return true if there is a constraint attached that is to be executed relative to collection members.
 boolean hasCount()
          Return true if the exists statement has a counter attached to it.
 
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 each collection member being iterated over. Use hasConstraint() to check if it exists first.

Returns:
the constraint or null

getCount

ICardinalityConstraint getCount()
Return the cardinality constraint (one, two, three, at least one, etc.), if there is one. Else returns null. Call hasCount() to check first.

Returns:
the cardinality constraint or null

getElement

IModelReference getElement()
Return the model reference being checked for existence. Never returns null.

Returns:
the model reference

hasConstraint

boolean hasConstraint()
Return true if there is a constraint attached that is to be executed relative to collection members.

Returns:
true if a constraint is attached

hasCount

boolean hasCount()
Return true if the exists statement has a counter attached to it.

Returns:
true if there is a counter


Copyright © 2006-2010 Christian Nentwich and others