@Test public void testevalExpression() { ValueFilterInequality vfi = new ValueFilterInequality(); assertEquals(false, vfi.evalExpression("lasfdt", 100, 200)); assertEquals(false, vfi.evalExpression("gteq", 5, 10)); assertEquals(true, vfi.evalExpression("gteq", 10, 5)); assertEquals(true, vfi.evalExpression("gt", 10, 5)); assertEquals(true, vfi.evalExpression("lt", 100, 200)); assertEquals(true, vfi.evalExpression("lteq", 7, 7)); assertEquals(false, vfi.evalExpression("eq", 100, 101)); assertEquals(true, vfi.evalExpression("eq", 137, 137)); }
protected boolean evalExpression(String op, long val, long rh) { if (op.equals("gteq")) { return val >= rh; } else if (op.equals("lteq")) { return val <= rh; } else if (op.equals("lt")) { return val < rh; } else if (op.equals("gt")) { return val > rh; } else if (op.equals("eq")) { return val == rh; } return false; }
ValueFilterInequality extends AbstractValueFilter { protected boolean evalExpression(String op, long val, long rh) { if (op.equals("gteq")) { return val >= rh; } else if (op.equals("lteq")) { return val <= rh; } else if (op.equals("lt")) { return val < rh; } else if (op.equals("gt")) { return val > rh; } else if (op.equals("eq")) { return val == rh; } return false; } }
ValueFilterInequality extends AbstractValueFilter { protected boolean evalExpression(String op, long val, long rh) { if (op.equals("gteq")) { return val >= rh; } else if (op.equals("lteq")) { return val <= rh; } else if (op.equals("lt")) { return val < rh; } else if (op.equals("gt")) { return val > rh; } else if (op.equals("eq")) { return val == rh; } return false; } ValueFilterInequality();  ValueFilterInequality(String iop, Long rh); }
ValueFilterInequality extends AbstractValueFilter { protected boolean evalExpression(String op, long val, long rh) { if (op.equals("gteq")) { return val >= rh; } else if (op.equals("lteq")) { return val <= rh; } else if (op.equals("lt")) { return val < rh; } else if (op.equals("gt")) { return val > rh; } else if (op.equals("eq")) { return val == rh; } return false; } ValueFilterInequality();  ValueFilterInequality(String iop, Long rh); @Override ValueObject filterValue(ValueObject value); }
ValueFilterInequality extends AbstractValueFilter { protected boolean evalExpression(String op, long val, long rh) { if (op.equals("gteq")) { return val >= rh; } else if (op.equals("lteq")) { return val <= rh; } else if (op.equals("lt")) { return val < rh; } else if (op.equals("gt")) { return val > rh; } else if (op.equals("eq")) { return val == rh; } return false; } ValueFilterInequality();  ValueFilterInequality(String iop, Long rh); @Override ValueObject filterValue(ValueObject value);  }