Package io.lionweb.lioncore.java.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 INode
TODO consider if the Model should have a version too
-
Method Summary
Modifier and TypeMethodDescriptionThe concept of which this Node is an instance.Return the Containment feature used to hold this Node within its parent.getID()
This return the Node ID.The immediate parent of the Node.default Node
getRoot()
If a Node is a root node in a Model, this method returns the node itself.default boolean
isRoot()
Return a list containing this node and all its descendants.Methods inherited from interface io.lionweb.lioncore.java.model.ClassifierInstance
addAnnotation, getAnnotations, getAnnotations, removeAnnotation
Methods inherited from interface io.lionweb.lioncore.java.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:
getID
in 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:ClassifierInstance
The immediate parent of the Node. This should be null only for root nodes.- Specified by:
getParent
in interfaceClassifierInstance<Concept>
-
getClassifier
Concept getClassifier()The concept of which this Node is an instance. The Concept should not be abstract.- Specified by:
getClassifier
in interfaceClassifierInstance<Concept>
-
getContainmentFeature
Containment 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). -
thisAndAllDescendants
Return a list containing this node and all its descendants. Does not include annotations.
-