Class Directions
java.lang.Object
com.dassault_systemes.modeler.kerml.model.Directions
Utility class to work with a direction of
Feature-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FeatureDirectionKindgetDirection(Feature feature, Type context) Returns the direction of the feature in the given context.static FeatureDirectionKindgetDirectionByFeatures(Feature feature) Calculates direction by direction of its featuresType.getFeature().static FeatureDirectionKindgetDirectionInOwningType(Feature feature, Type owningType) Returns the direction of the feature within the given owning type.static FeatureDirectionKindgetEffectiveDirection(Feature feature, Type context) Provides an effective or actual direction for a givenFeature.static booleanisInDirection(FeatureDirectionKind direction) Returns true if the direction is input or bidirectional.static booleanisInputInOwningType(Feature feature) Checks whether the feature is an input in its owning type.static booleanisInputInOwningType(Feature feature, Type owningType) Checks whether the feature is an input in the given owning type.static booleanisOutDirection(FeatureDirectionKind direction) Returns true if the direction is output or bidirectional.static booleanisOutputInOwningType(Feature feature) Checks whether the feature is an output in its owning type.static booleanisOutputInOwningType(Feature feature, Type owningType) Checks whether the feature is an output in the given owning type.
-
Constructor Details
-
Directions
public Directions()
-
-
Method Details
-
getDirectionInOwningType
@CheckForNull public static FeatureDirectionKind getDirectionInOwningType(Feature feature, @CheckForNull Type owningType) Returns the direction of the feature within the given owning type.- Parameters:
feature- the featureowningType- the type in which direction is evaluated- Returns:
- direction of the feature in the owning type, or null
-
isInputInOwningType
Checks whether the feature is an input in its owning type.- Parameters:
feature- the feature- Returns:
- true if the feature is an input
-
isInputInOwningType
Checks whether the feature is an input in the given owning type.- Parameters:
feature- the featureowningType- the type in which direction is evaluated- Returns:
- true if the feature is an input
-
isOutputInOwningType
Checks whether the feature is an output in its owning type.- Parameters:
feature- the feature- Returns:
- true if the feature is an output
-
isOutputInOwningType
Checks whether the feature is an output in the given owning type.- Parameters:
feature- the featureowningType- the type in which direction is evaluated- Returns:
- true if the feature is an output
-
isInDirection
Returns true if the direction is input or bidirectional.- Parameters:
direction- the direction- Returns:
- true if input-like
-
isOutDirection
Returns true if the direction is output or bidirectional.- Parameters:
direction- the direction- Returns:
- true if output-like
-
getDirectionByFeatures
Calculates direction by direction of its featuresType.getFeature().- Parameters:
feature- given feature- Returns:
- direction by features or null if all features are non-directional or there are no features
-
getDirection
@CheckForNull public static FeatureDirectionKind getDirection(Feature feature, @CheckForNull Type context) Returns the direction of the feature in the given context. If the feature has an explicit direction and the context is non-null, the direction is resolved relative to the containing type.- Parameters:
feature- the featurecontext- the context type- Returns:
- direction, or null
-
getEffectiveDirection
@CheckForNull public static FeatureDirectionKind getEffectiveDirection(Feature feature, @CheckForNull Type context) Provides an effective or actual direction for a givenFeature. Effective direction can be calculated, for example, from owned features.- Parameters:
feature- featurecontext- context of feature- Returns:
- direction
-