Class Constraints
java.lang.Object
com.dassault_systemes.modeler.sysml.model.Constraints
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Stream<Expression> getOwnedExpressions(ConstraintUsage constraintUsage) Returns a stream of allExpressionelements owned by the givenConstraintUsage.static booleanisAssumeConstraint(Element constraint) Returns whether the given constraint is an assumption constraint.static booleanisConstraintUsageOrDefinition(Element element) Returns whether the given element is aConstraintUsageorConstraintDefinition.static booleanisConstraintUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents a constraint usage or constraint definition.static booleanisPureConstraintUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass) static booleanisRequireConstraint(Element constraint) Returns whether the given constraint is a requirement constraint.static booleanisRequirementAssumeOrRequire(Element constraint) Returns whether the given element is aConstraintUsagethat is either an assumption or a requirement constraint.
-
Constructor Details
-
Constraints
public Constraints()
-
-
Method Details
-
isConstraintUsageOrDefinition
Returns whether the given element is aConstraintUsageorConstraintDefinition.- Parameters:
element- the element to test- Returns:
trueif the element is a constraint usage or definition
-
isConstraintUsageOrDefinition
public static boolean isConstraintUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass) Returns whether the givenEClassrepresents a constraint usage or constraint definition.- Parameters:
eClass- the class to test- Returns:
trueif the class is a constraint usage or definition
-
isPureConstraintUsageOrDefinition
public static boolean isPureConstraintUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass) - Parameters:
eClass- the class to test- Returns:
trueif the class is the pure constraint usage or definition type
-
getOwnedExpressions
Returns a stream of allExpressionelements owned by the givenConstraintUsage. Includes expressions owned by the constraint definition and the usage itself.Special handling is applied for
AssertConstraintUsage, which delegates to its asserted constraint.- Parameters:
constraintUsage- the constraint usage whose expressions are requested- Returns:
- a stream of owned expressions
-
isAssumeConstraint
Returns whether the given constraint is an assumption constraint. Assumption constraints are identified through theirRequirementConstraintMembershipkind.- Parameters:
constraint- the constraint element to test- Returns:
trueif the constraint is an assumption
-
isRequireConstraint
Returns whether the given constraint is a requirement constraint. Requirement constraints are identified through theirRequirementConstraintMembershipkind.- Parameters:
constraint- the constraint element to test- Returns:
trueif the constraint is a requirement
-
isRequirementAssumeOrRequire
Returns whether the given element is aConstraintUsagethat is either an assumption or a requirement constraint.- Parameters:
constraint- the element to test- Returns:
trueif the element is an assume or require constraint
-