예제 #1
0
 private static Type type(DSHandle l, DSHandle r) throws ExecutionException {
   Type tl = l.getType();
   Type tr = r.getType();
   if (Types.STRING.equals(tl) || Types.STRING.equals(tr)) {
     return Types.STRING;
   } else if (Types.FLOAT.equals(tl) || Types.FLOAT.equals(tr)) {
     return Types.FLOAT;
   } else {
     return Types.INT;
   }
 }
예제 #2
0
파일: Tracer.java 프로젝트: JoeHorn/swift-k
 public static Object unwrapHandle(Object o) {
   if (o instanceof AbstractDataNode) {
     AbstractDataNode h = (AbstractDataNode) o;
     if (h.isClosed()) {
       if (h.getType().isPrimitive()) {
         if (Types.STRING.equals(h.getType())) {
           return "\"" + h.getValue() + '"';
         } else {
           return h.getValue();
         }
       } else if (h.getType().isComposite()) {
         return getVarName(h);
       } else {
         return fileName(h);
       }
     } else {
       return "?" + getVarName(h);
     }
   } else {
     return o;
   }
 }