Browse Source

StateValues.setValue(int i, Object val) utility method.

accumulation-v4.7
Dave Parker 7 years ago
parent
commit
e15dfc7999
  1. 11
      prism/src/explicit/StateValues.java

11
prism/src/explicit/StateValues.java

@ -320,6 +320,17 @@ public class StateValues implements StateVector
// METHODS TO MODIFY VECTOR // METHODS TO MODIFY VECTOR
public void setValue(int i, Object val) throws PrismLangException
{
if (type instanceof TypeBool) {
setBooleanValue(i, ((TypeBool) type).castValueTo(val));
} else if (type instanceof TypeInt) {
setIntValue(i, ((TypeInt) type).castValueTo(val));
} else if (type instanceof TypeDouble) {
setDoubleValue(i, ((TypeDouble) type).castValueTo(val).doubleValue());
}
}
public void setIntValue(int i, int val) public void setIntValue(int i, int val)
{ {
valuesI[i] = val; valuesI[i] = val;

Loading…
Cancel
Save