|
|
|
@ -250,6 +250,9 @@ public class Values implements Cloneable //implements Comparable |
|
|
|
if (o instanceof Integer) { |
|
|
|
return ((Integer)o).intValue(); |
|
|
|
} |
|
|
|
if (o instanceof BigRational) { |
|
|
|
return ((BigRational)o).toInt(); |
|
|
|
} |
|
|
|
|
|
|
|
throw new PrismLangException("Cannot get integer value for \"" + getName(i) + "\""); |
|
|
|
} |
|
|
|
@ -273,6 +276,9 @@ public class Values implements Cloneable //implements Comparable |
|
|
|
if (o instanceof Double) { |
|
|
|
return ((Double)o).doubleValue(); |
|
|
|
} |
|
|
|
if (o instanceof BigRational) { |
|
|
|
return ((BigRational)o).doubleValue(); |
|
|
|
} |
|
|
|
|
|
|
|
throw new PrismLangException("Cannot get double value for \"" + getName(i) + "\""); |
|
|
|
} |
|
|
|
@ -286,11 +292,13 @@ public class Values implements Cloneable //implements Comparable |
|
|
|
|
|
|
|
o = values.get(i); |
|
|
|
|
|
|
|
if (!(o instanceof Boolean)) { |
|
|
|
if (o instanceof Boolean) { |
|
|
|
return ((Boolean)o).booleanValue(); |
|
|
|
} else if (o instanceof BigRational) { |
|
|
|
return ((BigRational)o).toBoolean(); |
|
|
|
} else { |
|
|
|
throw new PrismLangException("Cannot get boolean value for \"" + getName(i) + "\""); |
|
|
|
} |
|
|
|
|
|
|
|
return ((Boolean)o).booleanValue(); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
|