Class Connectors
java.lang.Object
com.dassault_systemes.modeler.kerml.model.Connectors
Utility class to work with
Connector-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndex of the source end feature for the connector.static final intIndex of the target end feature for the connector -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Collection<Connector> getConnectedConnectors(Feature feature) Returns all connectors connected to the given feature.static FeaturegetConnectorEndSourceFeature(Connector connector) Returns the source feature of the connector end.getConnectorEndTargetFeature(Connector connector) Returns the target features of the connector end.getEndChain(Connector connector, int endIndex) Returns the feature chain for the specified connector end.getEndChain(Feature end) Returns the feature chain for the given end feature.static FeaturegetEndChainFirstFeature(Connector connector, int endIndex) Returns the first feature in the chain of the specified connector end.static FeaturegetEndChainLastFeature(Connector connector, int endIndex) Returns the last feature in the chain of the specified connector end.static FeatureReturns the last feature in the chain of the given end feature.static FeaturegetEndFeature(Type type, int endIndex) Returns the end feature at the given index of the type.static <T extends Feature>
TgetOrCreateEndFeature(Connector connector, int endIndex) Returns the end feature at the given index, creating it if necessary.getSourceChain(Connector connector) Returns the source end chain of the connector.static FeaturegetSourceChainLastFeature(Connector connector) Returns the last feature in the source end chain of the connector.static FeaturegetSourceEnd(Connector connector) Returns the source end feature of the connector.getTargetChain(Connector connector) Returns the target end chain of the connector.static FeaturegetTargetChainLastFeature(Connector connector) Returns the last feature in the target end chain of the connector.static FeaturegetTargetEnd(Connector connector) Returns the target end feature of the connector.static booleanisConnectorOrRepresentsConnector(Element element) Checks whether the element is a connector or represents one via relationship mapping.static booleanChecks whether the given type is the context of the connector.static booleanisNaryConnector(ModelElement element) Checks whether the given model element is an n‑ary connector.static booleanisPackageLevel(Connector connector) Checks whether the connector is defined at package level.static booleansetEndChain(Connector connector, int endIndex, List<? extends Feature> chain) Sets the feature chain for the specified connector end.static booleansetEndChain(Feature end, List<? extends Feature> chain) Sets the feature chain for the given end feature.static booleansetSourceChain(Connector connector, List<? extends Feature> chain) Sets the source end chain of the connector.static booleansetTargetChain(Connector connector, List<? extends Feature> chain) Sets the target end chain of the connector.
-
Field Details
-
SOURCE_INDEX
public static final int SOURCE_INDEXIndex of the source end feature for the connector.- See Also:
-
TARGET_INDEX
public static final int TARGET_INDEXIndex of the target end feature for the connector- See Also:
-
-
Constructor Details
-
Connectors
public Connectors()
-
-
Method Details
-
getSourceChainLastFeature
Returns the last feature in the source end chain of the connector.- Parameters:
connector- the connector- Returns:
- last feature of the source chain, or null
-
getTargetChainLastFeature
Returns the last feature in the target end chain of the connector.- Parameters:
connector- the connector- Returns:
- last feature of the target chain, or null
-
getEndChainLastFeature
Returns the last feature in the chain of the specified connector end.- Parameters:
connector- the connectorendIndex- index of the end (0 = source, 1 = target)- Returns:
- last feature of the chain, or null
-
getEndChainLastFeature
Returns the last feature in the chain of the given end feature.- Parameters:
end- the end feature- Returns:
- last feature of the chain, or null
-
getEndChainFirstFeature
Returns the first feature in the chain of the specified connector end.- Parameters:
connector- the connectorendIndex- index of the end (0 = source, 1 = target)- Returns:
- first feature of the chain, or null
-
setSourceChain
Sets the source end chain of the connector.- Parameters:
connector- the connectorchain- feature chain- Returns:
- true if updated
-
getSourceChain
Returns the source end chain of the connector.- Parameters:
connector- the connector- Returns:
- source chain
-
setTargetChain
Sets the target end chain of the connector.- Parameters:
connector- the connectorchain- feature chain- Returns:
- true if updated
-
getTargetChain
Returns the target end chain of the connector.- Parameters:
connector- the connector- Returns:
- target chain
-
getSourceEnd
Returns the source end feature of the connector.- Parameters:
connector- the connector- Returns:
- source end feature, or null
-
getTargetEnd
Returns the target end feature of the connector.- Parameters:
connector- the connector- Returns:
- target end feature, or null
-
getEndChain
Returns the feature chain for the specified connector end.- Parameters:
connector- the connectorendIndex- index of the end- Returns:
- feature chain
-
getEndChain
Returns the feature chain for the given end feature.- Parameters:
end- the end feature- Returns:
- feature chain
-
getEndFeature
Returns the end feature at the given index of the type.- Parameters:
type- the typeendIndex- index of the end- Returns:
- end feature, or null
-
setEndChain
Sets the feature chain for the specified connector end.- Parameters:
connector- the connectorendIndex- index of the endchain- feature chain- Returns:
- true if updated
-
setEndChain
Sets the feature chain for the given end feature.- Parameters:
end- the end featurechain- feature chain- Returns:
- true if updated
-
getOrCreateEndFeature
Returns the end feature at the given index, creating it if necessary.- Type Parameters:
T- feature type- Parameters:
connector- the connectorendIndex- index of the end- Returns:
- existing or newly created end feature
-
getConnectorEndSourceFeature
Returns the source feature of the connector end.- Parameters:
connector- the connector- Returns:
- source feature, or null
-
getConnectorEndTargetFeature
Returns the target features of the connector end.- Parameters:
connector- the connector- Returns:
- list of target features
-
getConnectedConnectors
Returns all connectors connected to the given feature.- Parameters:
feature- the feature- Returns:
- connected connectors
-
isPackageLevel
Checks whether the connector is defined at package level.- Parameters:
connector- the connector- Returns:
- true if package‑level
-
isContext
Checks whether the given type is the context of the connector.- Parameters:
context- the typeconnector- the connector- Returns:
- true if the type is the connector's context
-
isConnectorOrRepresentsConnector
Checks whether the element is a connector or represents one via relationship mapping.- Parameters:
element- the element- Returns:
- true if connector or represents a connector
-
isNaryConnector
Checks whether the given model element is an n‑ary connector.- Parameters:
element- the model element- Returns:
- true if n‑ary connector
-