/** * Get the value at the index. * @param index The index. */ public Object getObject(int index) { Tuple target = this; for(int i=size-1; i>index; i--) target = target.getLastTuple(); return target.getObject(); }
/** * Get the value at the index. * @param index The index. */ public Object getObject(int index) { Tuple target = this; for(int i=size-1; i>index; i--) target = target.getLastTuple(); return target.getObject(); }
/** * Get the values. */ public List getObjects() { List ret = new LinkedList(); Tuple current = this; while(current!=null) { ret.add(0, current.getObject()); current = current.getLastTuple(); } return ret; }
/** * Get the values. */ public List getObjects() { List ret = new LinkedList(); Tuple current = this; while(current!=null) { ret.add(0, current.getObject()); current = current.getLastTuple(); } return ret; }
/** * Evaluate the constraints given the right object, left tuple * (null for alpha nodes) and the state. * @param right The right input object. * @param left The left input tuple. * @param state The working memory. */ public boolean evaluate(Object right, Tuple left, IOAVState state) { // System.out.println("Not match: "+left+", "+right); Tuple tright = (Tuple)right; int diff = tright.size() - left.size(); for(int i=0; i<diff; i++) tright = tright.getLastTuple(); return left.equals(tright); }
/** * Evaluate the constraints given the right object, left tuple * (null for alpha nodes) and the state. * @param right The right input object. * @param left The left input tuple. * @param state The working memory. */ public boolean evaluate(Object right, Tuple left, IOAVState state) { // System.out.println("Not match: "+left+", "+right); Tuple tright = (Tuple)right; int diff = tright.size() - left.size(); for(int i=0; i<diff; i++) tright = tright.getLastTuple(); return left.equals(tright); }
if(next.getLastTuple().equals(left)) System.out.println("error: "+this+" "+next); assert !next.getLastTuple().equals(left) : "Tuple not removed: "+left+", "+this;
if(next.getLastTuple().equals(left)) System.out.println("error: "+this+" "+next); assert !next.getLastTuple().equals(left) : "Tuple not removed: "+left+", "+this;