Package io.lionweb.model
Interface Node
- All Superinterfaces:
ClassifierInstance<Concept>,HasFeatureValues
- All Known Implementing Classes:
Annotation,Classifier,Concept,Containment,DataType,DynamicNode,Enumeration,EnumerationLiteral,Feature,Field,Interface,Language,LanguageEntity,Link,LionCoreBuiltins,M3Node,PrimitiveType,Property,ProxyNode,Reference,StructuredDataType
A node is an instance of a Concept. It contains all the values associated to that instance.
- See Also:
-
Ecore equivalent EObject- MPS equivalent Node in documentation
Modelix equivalent INodeTODO consider if the Model should have a version too
-
Method Summary
Modifier and TypeMethodDescriptionThe concept of which this Node is an instance.default ContainmentReturn the Containment feature used to hold this Node within its parent.getID()This return the Node ID.The immediate parent of the Node.default NodegetRoot()If a Node is a root node in a Model, this method returns the node itself.default booleanisRoot()Return a list containing this node and all its descendants.Methods inherited from interface io.lionweb.model.ClassifierInstance
addAnnotation, getAnnotations, getAnnotations, removeAnnotationMethods inherited from interface io.lionweb.model.HasFeatureValues
addChild, addReferenceValue, getChildren, getPropertyValue, getReferenceValues, removeChild, removeChild, removeReferenceValue, removeReferenceValue, setPropertyValue, setReferenceValues
-
Method Details
-
getID
This return the Node ID.A valid Node ID should not be null, but this method can return a null value in case the Node is in invalid state.
- Specified by:
getIDin interfaceClassifierInstance<Concept>
-
getRoot
If a Node is a root node in a Model, this method returns the node itself. Otherwise it returns the ancestor which is a root node. This method should return null only if the Node is not inserted in a Model and it is therefore considered a dangling Node. -
isRoot
default boolean isRoot() -
getParent
ClassifierInstance<?> getParent()Description copied from interface:ClassifierInstanceThe immediate parent of the Node. This should be null only for root nodes.- Specified by:
getParentin interfaceClassifierInstance<Concept>
-
getClassifier
Concept getClassifier()The concept of which this Node is an instance. The Concept should not be abstract.- Specified by:
getClassifierin interfaceClassifierInstance<Concept>
-
getContainmentFeature
Return the Containment feature used to hold this Node within its parent. This will be null only for root nodes or dangling nodes (which are not distinguishable by looking at the node itself).- Returns:
- the Containment holding the Node. Or null, if the Node has no parent
- See Also:
-
thisAndAllDescendants
Return a list containing this node and all its descendants. Does not include annotations.
-