Package cruise.umple.compiler
Class Guard
java.lang.Object
cruise.umple.compiler.ConstraintVariable
cruise.umple.compiler.ConstraintTree
cruise.umple.compiler.Guard
- All Implemented Interfaces:
java.lang.Iterable<ConstraintVariable>
public class Guard extends ConstraintTree
A boolean condition that is checked when an event method is called
If the result is true the transition may be taken
NEW CLASS****************************************
-
Constructor Summary
Constructors Constructor Description Guard()
-
Method Summary
Modifier and Type Method Description Guard
clone()
Please maintain this method if you're going to add new features to Guards.void
delete()
java.lang.String
getCondition(CodeTranslator gen)
Position
getEndPosition()
java.lang.String
getExpression()
This converts a guard expression into its equivalent string representationPosition
getPosition()
java.util.ArrayDeque<java.lang.String>
getQueuedExpression()
This builds an expression queue (of String type) from this Guard object.boolean
setEndPosition(Position aEndPosition)
boolean
setPosition(Position aPosition)
java.lang.String
toString()
Methods inherited from class cruise.umple.compiler.ConstraintTree
addElement, addElementAll, clone, createNew, equals, getDisplayBrackets, getDisplayNegation, getNamedNames, getNames, getNumberOfElements, getRequestor, getRoot, getShouldDisplayBrackets, getType, hashCode, isEqualTo, isNegatable, iterator, negate, setDisplayNegation, setNames, setNumberOfElements, setRequestor, setRoot, setShouldDisplayBrackets
-
Constructor Details
-
Guard
public Guard()
-
-
Method Details
-
setPosition
-
setEndPosition
-
getPosition
-
getEndPosition
-
delete
public void delete()- Overrides:
delete
in classConstraintTree
-
getQueuedExpression
public java.util.ArrayDeque<java.lang.String> getQueuedExpression()This builds an expression queue (of String type) from this Guard object. These include negation, operators, variable names etc. -
getExpression
public java.lang.String getExpression()This converts a guard expression into its equivalent string representation -
getCondition
-
clone
Please maintain this method if you're going to add new features to Guards. This code manually creates a clone of a Guards.- Overrides:
clone
in classjava.lang.Object
-
toString
public java.lang.String toString()- Overrides:
toString
in classConstraintTree
-