Skip to content

Instantly share code, notes, and snippets.

@leogomes
Created November 23, 2010 15:40
Show Gist options
  • Save leogomes/711951 to your computer and use it in GitHub Desktop.
Save leogomes/711951 to your computer and use it in GitHub Desktop.
right memory iteration
RightTuple first = new RightTuple(
(InternalFactHandle) expectedFactHandles.get(0));
List<RightTuple> actualRightTuples = new ArrayList<RightTuple>();
for (RightTuple rightTuple = rightMemory.getFirst(first); rightTuple != null; rightTuple = (RightTuple) rightTuple.getNext()) {
actualRightTuples.add(rightTuple);
}
// ----
Iterator it = rightMemory.iterator();
for (RightTuple rt = (RightTuple) it.next(); rt != null; rt = (RightTuple) it.next()) {
actualRightTuples.add(rt);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment