public boolean hasNext() { if ( ! rodQueue.hasNext() ) return false; else { return ! rodQueue.peekLocation().isPast(locus); } }
public Collection<RODRecordList> allElementsLTE(RODRecordList elt, boolean includeElt) { LinkedList<RODRecordList> all = new LinkedList<RODRecordList>(); if ( includeElt ) all.add(elt); while ( hasNext() ) { Element x = queue.peek(); //System.out.printf("elt.compareTo(x) == %d%n", elt.compareTo(x)); //System.out.printf("In allElementLTE%n"); int cmp = elt.getLocation().compareTo(x.nextLoc); //System.out.printf("x=%s%n elt=%s%n => elt.compareTo(x) == %d%n", x, elt, cmp); if ( cmp >= 0 ) { //System.out.printf(" Adding element x=%s, size = %d%n", x, all.size()); all.add(next()); //System.out.printf(" Added size = %d%n", all.size()); } else { //System.out.printf("breaking...%n"); break; } } return all; }