public Object computeValue(EvalContext context) { return equal(context, args[0], args[1]) ? Boolean.TRUE : Boolean.FALSE; }
/** * Learn whether lit intersects rit. * @param lit left Iterator * @param rit right Iterator * @return boolean */ protected boolean findMatch(Iterator lit, Iterator rit) { HashSet left = new HashSet(); while (lit.hasNext()) { left.add(lit.next()); } while (rit.hasNext()) { if (contains(left.iterator(), rit.next())) { return true; } } return false; }
/** * Learn whether it contains value. * @param it Iterator to check * @param value for which to look * @return whether value was found */ protected boolean contains(Iterator it, Object value) { while (it.hasNext()) { Object element = it.next(); if (equal(element, value)) { return true; } } return false; }