示例#1
0
 private static double getFloat(Node n, DSHandle h) {
   waitFor(n, h);
   Object v = h.getValue();
   if (v instanceof Number) {
     return ((Number) v).doubleValue();
   } else {
     throw new ExecutionException(n, "Internal error. Expected float: " + h);
   }
 }
示例#2
0
 private static boolean getBool(Node n, DSHandle h) {
   waitFor(n, h);
   Object v = h.getValue();
   if (v instanceof Boolean) {
     return ((Boolean) v).booleanValue();
   } else {
     throw new ExecutionException(n, "Internal error. Expected float: " + h);
   }
 }
示例#3
0
 private static int getInt(Node n, DSHandle h) {
   waitFor(n, h);
   Object v = h.getValue();
   if (v instanceof Integer) {
     return ((Integer) v).intValue();
   } else {
     throw new ExecutionException(n, "Internal error. Expected an int: " + v + " (" + h + ")");
   }
 }