Class ListWrapperValue
- java.lang.Object
-
- net.ssehub.easy.varModel.model.values.Value
-
- net.ssehub.easy.varModel.cstEvaluation.ListWrapperValue
-
class ListWrapperValue extends Value
Special wrapper value for lists. To be used just for iteration evaluation.- Author:
- Holger Eichelberger
-
-
Constructor Summary
Constructors Constructor Description ListWrapperValue(java.util.List<Value> values)Creates a list wrapper value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(IValueVisitor visitor)Abstract accept method.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.ValuegetElement(int index)Returns the specified element.intgetElementCount()Returns the number of elements in the wrapped list.java.lang.ObjectgetValue()Abstract getValue method.booleanisConfigured()Abstract Method to check whether a value is configured.voidsetValue(java.lang.Object value)Abstract setValue-method.-
Methods inherited from class net.ssehub.easy.varModel.model.values.Value
clone, equals, equals, equalsPartially, getContainedType, getType, getValueParent, hashCode, setValueParent, stringValueOf, toString
-
-
-
-
Field Detail
-
values
private java.util.List<Value> values
-
-
Constructor Detail
-
ListWrapperValue
ListWrapperValue(java.util.List<Value> values)
Creates a list wrapper value.- Parameters:
values- the list values
-
-
Method Detail
-
getValue
public java.lang.Object 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.
-
getElementCount
public int getElementCount()
Returns the number of elements in the wrapped list.- Returns:
- the number of elements
-
getElement
public Value getElement(int index)
Returns the specified element.- Parameters:
index- the 0-based index of the element- Returns:
- the element
- Throws:
java.lang.IndexOutOfBoundsException- ifindex<0 || index>=getElementCount()
-
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
-
-