示例#1
0
 @Override
 public Value apply(Spreadsheet s, List<Expression> args) {
   Value a = args.get(0).evaluate(s).resolve(s);
   Value b = args.get(1).evaluate(s).resolve(s);
   switch (op) {
     case less:
       return a.compareTo(b) < 0 ? TrueValue.get() : null;
     case lesseq:
       return a.compareTo(b) <= 0 ? TrueValue.get() : null;
     case eq:
       return a.compareTo(b) == 0 ? TrueValue.get() : null;
     case grtr:
       return a.compareTo(b) > 0 ? TrueValue.get() : null;
     case grtreq:
       return a.compareTo(b) >= 0 ? TrueValue.get() : null;
     case noteq:
       return a.compareTo(b) != 0 ? TrueValue.get() : null;
     default:
       return null;
   }
 }
示例#2
0
 @Override
 public Value apply(Spreadsheet s, List<Expression> args) {
   return args.get(0).evaluate(s).resolve(s) == null ? TrueValue.get() : null;
 }