Package cruise.umple.compiler
Class TraceConstraint
java.lang.Object
cruise.umple.compiler.ConstraintVariable
cruise.umple.compiler.ConstraintTree
cruise.umple.compiler.TraceConstraint
- All Implemented Interfaces:
java.lang.Iterable<ConstraintVariable>
public class TraceConstraint extends ConstraintTree
TraceConstraint objects ensure that the attribute being traced will be treated as a parameter and not a member variable
-
Constructor Summary
Constructors Constructor Description TraceConstraint()
-
Method Summary
Modifier and Type Method Description ConstraintVariable
addElement(ConstraintVariable aElement)
Adds a node to the tree, the three modes are - if nothing exists in the tree: set the element as the root - if the element is an operator: add the root if it is not null as an operand to the operator, and set the operator to the root - if there exists an operator: add the element as an operand to the operator.boolean
addOrMoveVariableAt(UmpleVariable aVariable, int index)
boolean
addVariable(UmpleVariable aVariable)
boolean
addVariableAt(UmpleVariable aVariable, int index)
ConstraintTree
createNew()
Creates a new instance of this class, it is used in clone and addElement in order to copy a tree so that there is a deep copy instead of a shallow one This method needs to be overrided for sub classes of ConstaintTree to function properly.void
delete()
UmpleVariable
getVariable(int index)
java.util.List<UmpleVariable>
getVariables()
boolean
hasVariables()
int
indexOfVariable(UmpleVariable aVariable)
static int
minimumNumberOfVariables()
int
numberOfVariables()
boolean
removeVariable(UmpleVariable aVariable)
Methods inherited from class cruise.umple.compiler.ConstraintTree
addElementAll, clone, equals, getDisplayBrackets, getDisplayNegation, getNamedNames, getNames, getNumberOfElements, getRequestor, getRoot, getShouldDisplayBrackets, getType, hashCode, isEqualTo, isNegatable, iterator, negate, setDisplayNegation, setNames, setNumberOfElements, setRequestor, setRoot, setShouldDisplayBrackets, toString
-
Constructor Details
-
TraceConstraint
public TraceConstraint()
-
-
Method Details
-
getVariable
-
getVariables
-
numberOfVariables
public int numberOfVariables() -
hasVariables
public boolean hasVariables() -
indexOfVariable
-
minimumNumberOfVariables
public static int minimumNumberOfVariables() -
addVariable
-
removeVariable
-
addVariableAt
-
addOrMoveVariableAt
-
delete
public void delete()- Overrides:
delete
in classConstraintTree
-
createNew
Description copied from class:ConstraintTree
Creates a new instance of this class, it is used in clone and addElement in order to copy a tree so that there is a deep copy instead of a shallow one This method needs to be overrided for sub classes of ConstaintTree to function properly.- Overrides:
createNew
in classConstraintTree
-
addElement
Description copied from class:ConstraintTree
Adds a node to the tree, the three modes are - if nothing exists in the tree: set the element as the root - if the element is an operator: add the root if it is not null as an operand to the operator, and set the operator to the root - if there exists an operator: add the element as an operand to the operator.- Overrides:
addElement
in classConstraintTree
-