Class DynamicClassifierInstance<T extends Classifier<T>>
java.lang.Object
io.lionweb.lioncore.java.model.impl.AbstractClassifierInstance<T>
io.lionweb.lioncore.java.model.impl.DynamicClassifierInstance<T>
- All Implemented Interfaces:
ClassifierInstance<T>
,HasFeatureValues
- Direct Known Subclasses:
DynamicAnnotationInstance
,DynamicNode
public abstract class DynamicClassifierInstance<T extends Classifier<T>>
extends AbstractClassifierInstance<T>
implements ClassifierInstance<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
The ID should _eventually_ be not null.protected final Map<String,
List<ReferenceValue>> Fields inherited from class io.lionweb.lioncore.java.model.impl.AbstractClassifierInstance
annotations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChild
(Containment containment, Node child) Add a child to the specified list of children associated with the given Containment relation.void
addReferenceValue
(Reference reference, ReferenceValue value) Add the Node to the list of Nodes referred to from this Node under the given Reference.getChildren
(Containment containment) This return all the Nodes directly contained into this Node under the specific Containment relation specified.getID()
getPropertyValue
(Property property) Get the property value associated with the specified property.getReferenceValues
(Reference reference) void
removeChild
(Containment containment, int index) Remove the child at the given index, considering the children under the given containment.void
removeChild
(Node node) Remove the given child from the list of children associated with the Node, making it a dangling Node.void
removeReferenceValue
(Reference reference, int index) Remove the reference value at the given index, considering the reference values under the given reference.void
removeReferenceValue
(Reference reference, ReferenceValue referenceValue) Remove the first reference value that is equal to the given referenceValue.void
The ID can be _temporarily_ set to null, but _eventually_ it should be not null.void
setPropertyValue
(Property property, Object value) void
setReferenceValues
(Reference reference, List<? extends ReferenceValue> values) Methods inherited from class io.lionweb.lioncore.java.model.impl.AbstractClassifierInstance
addAnnotation, getAnnotations, getAnnotations, removeAnnotation
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.lionweb.lioncore.java.model.ClassifierInstance
addAnnotation, getAnnotations, getAnnotations, getClassifier, getParent, removeAnnotation
-
Field Details
-
id
The ID should _eventually_ be not null. -
propertyValues
-
containmentValues
-
referenceValues
-
-
Constructor Details
-
DynamicClassifierInstance
public DynamicClassifierInstance()
-
-
Method Details
-
getID
- Specified by:
getID
in interfaceClassifierInstance<T extends Classifier<T>>
-
setID
The ID can be _temporarily_ set to null, but _eventually_ it should be not null. -
getPropertyValue
Description copied from interface:HasFeatureValues
Get the property value associated with the specified property.- Specified by:
getPropertyValue
in interfaceHasFeatureValues
-
setPropertyValue
- Specified by:
setPropertyValue
in interfaceHasFeatureValues
-
getChildren
Description copied from interface:HasFeatureValues
This return all the Nodes directly contained into this Node under the specific Containment relation specified.- Specified by:
getChildren
in interfaceHasFeatureValues
-
addChild
Description copied from interface:HasFeatureValues
Add a child to the specified list of children associated with the given Containment relation. If the specified Containment does not allow for multiple values, and if a value is already set than the exception IllegalStateException will be thrown.If the child has not a Concept compatible with the target of the Containement, the exception IllegalArgumentException will be thrown.
- Specified by:
addChild
in interfaceHasFeatureValues
-
removeChild
Description copied from interface:HasFeatureValues
Remove the given child from the list of children associated with the Node, making it a dangling Node. If the specified Node is not currently a child of this Node the exception IllegalArgumentException will be thrown.- Specified by:
removeChild
in interfaceHasFeatureValues
- Overrides:
removeChild
in classAbstractClassifierInstance<T extends Classifier<T>>
-
removeChild
Description copied from interface:HasFeatureValues
Remove the child at the given index, considering the children under the given containment.If there is no match the exception IllegalArgumentException will be thrown.
- Specified by:
removeChild
in interfaceHasFeatureValues
- Overrides:
removeChild
in classAbstractClassifierInstance<T extends Classifier<T>>
-
getReferenceValues
- Specified by:
getReferenceValues
in interfaceHasFeatureValues
-
addReferenceValue
Description copied from interface:HasFeatureValues
Add the Node to the list of Nodes referred to from this Node under the given Reference.If the Reference is not multiple, any previous value will be replaced.
The Node specified should be either part of this Node's Model or of Models imported by this Node's Model. If that is not the case the exception IllegalArgumentException will be thrown.
If the referredNode has not a Concept compatible with the target of the Reference, the exception IllegalArgumentException will be thrown.
- Specified by:
addReferenceValue
in interfaceHasFeatureValues
-
removeReferenceValue
public void removeReferenceValue(@Nonnull Reference reference, @Nullable ReferenceValue referenceValue) Description copied from interface:HasFeatureValues
Remove the first reference value that is equal to the given referenceValue. Node. If there is no match the exception IllegalArgumentException will be thrown.- Specified by:
removeReferenceValue
in interfaceHasFeatureValues
- Overrides:
removeReferenceValue
in classAbstractClassifierInstance<T extends Classifier<T>>
-
removeReferenceValue
Description copied from interface:HasFeatureValues
Remove the reference value at the given index, considering the reference values under the given reference.If there is no match the exception IllegalArgumentException will be thrown.
- Specified by:
removeReferenceValue
in interfaceHasFeatureValues
- Overrides:
removeReferenceValue
in classAbstractClassifierInstance<T extends Classifier<T>>
-
setReferenceValues
public void setReferenceValues(@Nonnull Reference reference, @Nonnull List<? extends ReferenceValue> values) - Specified by:
setReferenceValues
in interfaceHasFeatureValues
-