new constant value accessors
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1376 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
da8c93ec1a
commit
9ffe419bb3
|
@ -298,6 +298,13 @@ public class SymbolTable {
|
|||
return (String) ((ConstantValue) values[v]).getValue();
|
||||
}
|
||||
|
||||
public float getFloatValue(int v) throws IllegalArgumentException {
|
||||
if (!isNumberConstant(v)) {
|
||||
throw new IllegalArgumentException("value number " + v + " is not a numeric constant.");
|
||||
}
|
||||
return ((Number) ((ConstantValue) values[v]).getValue()).floatValue();
|
||||
}
|
||||
|
||||
public double getDoubleValue(int v) throws IllegalArgumentException {
|
||||
if (!isNumberConstant(v)) {
|
||||
throw new IllegalArgumentException("value number " + v + " is not a numeric constant.");
|
||||
|
@ -312,6 +319,13 @@ public class SymbolTable {
|
|||
return ((Number) ((ConstantValue) values[v]).getValue()).intValue();
|
||||
}
|
||||
|
||||
public long getLongValue(int v) throws IllegalArgumentException {
|
||||
if (!isNumberConstant(v)) {
|
||||
throw new IllegalArgumentException("value number " + v + " is not a numeric constant.");
|
||||
}
|
||||
return ((Number) ((ConstantValue) values[v]).getValue()).longValue();
|
||||
}
|
||||
|
||||
public Object getConstantValue(int v) throws IllegalArgumentException{
|
||||
if (!isConstant(v)) {
|
||||
throw new IllegalArgumentException("value number " + v + " is not a constant.");
|
||||
|
|
Loading…
Reference in New Issue