Package io.lionweb.model.impl
Class DynamicClassifierInstance<T extends Classifier<T>>
java.lang.Object
io.lionweb.model.impl.AbstractClassifierInstance<T>
io.lionweb.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 StringThe ID should _eventually_ be not null.protected final Map<String,List<ReferenceValue>> Fields inherited from class io.lionweb.model.impl.AbstractClassifierInstance
annotations -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddChild(Containment containment, Node child) Add a child to the specified list of children associated with the given Containment relation.voidaddReferenceValue(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) voidremoveChild(Containment containment, int index) Remove the child at the given index, considering the children under the given containment.voidremoveChild(Node node) Remove the given child from the list of children associated with the Node, making it a dangling Node.voidremoveReferenceValue(Reference reference, int index) Remove the reference value at the given index, considering the reference values under the given reference.voidremoveReferenceValue(Reference reference, ReferenceValue referenceValue) Remove the first reference value that is equal to the given referenceValue.voidThe ID can be _temporarily_ set to null, but _eventually_ it should be not null.voidsetPropertyValue(Property property, Object value) voidsetReferenceValues(Reference reference, List<? extends ReferenceValue> values) Methods inherited from class io.lionweb.model.impl.AbstractClassifierInstance
addAnnotation, getAnnotations, getAnnotations, removeAnnotationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.lionweb.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:
getIDin 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:HasFeatureValuesGet the property value associated with the specified property.- Specified by:
getPropertyValuein interfaceHasFeatureValues
-
setPropertyValue
- Specified by:
setPropertyValuein interfaceHasFeatureValues
-
getChildren
Description copied from interface:HasFeatureValuesThis return all the Nodes directly contained into this Node under the specific Containment relation specified.- Specified by:
getChildrenin interfaceHasFeatureValues
-
addChild
Description copied from interface:HasFeatureValuesAdd 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:
addChildin interfaceHasFeatureValues
-
removeChild
Description copied from interface:HasFeatureValuesRemove 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:
removeChildin interfaceHasFeatureValues- Overrides:
removeChildin classAbstractClassifierInstance<T extends Classifier<T>>
-
removeChild
Description copied from interface:HasFeatureValuesRemove 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:
removeChildin interfaceHasFeatureValues- Overrides:
removeChildin classAbstractClassifierInstance<T extends Classifier<T>>
-
getReferenceValues
- Specified by:
getReferenceValuesin interfaceHasFeatureValues
-
addReferenceValue
Description copied from interface:HasFeatureValuesAdd 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:
addReferenceValuein interfaceHasFeatureValues
-
removeReferenceValue
public void removeReferenceValue(@Nonnull Reference reference, @Nullable ReferenceValue referenceValue) Description copied from interface:HasFeatureValuesRemove 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:
removeReferenceValuein interfaceHasFeatureValues- Overrides:
removeReferenceValuein classAbstractClassifierInstance<T extends Classifier<T>>
-
removeReferenceValue
Description copied from interface:HasFeatureValuesRemove 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:
removeReferenceValuein interfaceHasFeatureValues- Overrides:
removeReferenceValuein classAbstractClassifierInstance<T extends Classifier<T>>
-
setReferenceValues
public void setReferenceValues(@Nonnull Reference reference, @Nonnull List<? extends ReferenceValue> values) - Specified by:
setReferenceValuesin interfaceHasFeatureValues
-