Class ReferenceValue
- java.lang.Object
-
- net.ssehub.easy.varModel.model.values.Value
-
- net.ssehub.easy.varModel.model.values.ReferenceValue
-
public class ReferenceValue extends Value
Reference value class.- Author:
- lueder
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractVariablevalueprivate ConstraintSyntaxTreevalueEx
-
Constructor Summary
Constructors Modifier Constructor Description (package private)ReferenceValue()Constructor for serialization.protectedReferenceValue(IDatatype origin, java.lang.Object... ref)Constructor for a new ReferenceValue.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IValueVisitor visitor)Abstract accept method.Valueclone()Clones the this value.booleanequals(java.lang.Object object)booleanequalsPartially(Value value)Returns whether the providedvalueis partially equal to this value, i.e., whether the nested elements ofvalue(if they exist) have the same contents as in this value.AbstractVariablegetValue()Abstract getValue method.ConstraintSyntaxTreegetValueEx()IfgetValue()is null, the actual value is determined by an expression that needs to be evaluated.inthashCode()booleanisConfigured()Abstract Method to check whether a value is configured.voidsetValue(java.lang.Object value)Abstract setValue-method.java.lang.StringtoString()-
Methods inherited from class net.ssehub.easy.varModel.model.values.Value
equals, equalsPartially, getContainedType, getType, getValueParent, setValueParent, stringValueOf
-
-
-
-
Field Detail
-
value
private AbstractVariable value
-
valueEx
private ConstraintSyntaxTree valueEx
-
-
Constructor Detail
-
ReferenceValue
ReferenceValue()
Constructor for serialization.
-
ReferenceValue
protected ReferenceValue(IDatatype origin, java.lang.Object... ref) throws ValueDoesNotMatchTypeException
Constructor for a new ReferenceValue.- Parameters:
origin- Reference which extends this ReferenceValueref- the reference of this value- Throws:
ValueDoesNotMatchTypeException- if one of the default values do not comply to the respective types
-
-
Method Detail
-
getValue
public AbstractVariable getValue()
Description copied from class:ValueAbstract getValue method. The result of this method must comply to the input conventions ofValueFactoryand the constructor of the respective implementing class.
-
getValueEx
public ConstraintSyntaxTree getValueEx()
IfgetValue()is null, the actual value is determined by an expression that needs to be evaluated.- Returns:
- the value expression
-
accept
public void accept(IValueVisitor visitor)
Description copied from class:ValueAbstract accept method.
-
setValue
public void setValue(java.lang.Object value) throws ValueDoesNotMatchTypeExceptionDescription copied from class:ValueAbstract setValue-method.- Specified by:
setValuein classValue- Parameters:
value- the value to set.- Throws:
ValueDoesNotMatchTypeException- if the given value does not match this type
-
isConfigured
public boolean isConfigured()
Description copied from class:ValueAbstract Method to check whether a value is configured.- Specified by:
isConfiguredin classValue- Returns:
- true = it is configured / false = it is not
-
equalsPartially
public boolean equalsPartially(Value value)
Description copied from class:ValueReturns whether the providedvalueis partially equal to this value, i.e., whether the nested elements ofvalue(if they exist) have the same contents as in this value. Other values of this value are not considered. The check is transitive on nested elements. Please consider that this method is not symmetric as opposed toequals. This method is important to cope with default values.- Specified by:
equalsPartiallyin classValue- Parameters:
value- the value to be checked for partial equality.- Returns:
trueifvalueis partially equal to this,falseelse
-
-