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); } }
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); } }
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 + ")"); } }