Ejemplo n.º 1
0
 public FilterIterator(CEConstraint ce, DapSequence seq, DataSequence data, CEAST filter) {
   this.ce = ce;
   this.filter = filter;
   this.seq = seq;
   this.data = data;
   this.nrecords = data.getRecordCount();
   this.recno = 0; // actually recno of next record to read
   this.current = null;
 }
Ejemplo n.º 2
0
 // Iterator interface
 public boolean hasNext() {
   if (recno < nrecords) return false;
   try {
     // look for next matching record starting at recno
     if (filter == null) {
       this.current = data.readRecord(this.recno);
       this.recno++;
       return true;
     } else
       for (; recno < nrecords; recno++) {
         this.current = data.readRecord(this.recno);
         if (ce.matches(this.seq, this.current, filter)) return true;
       }
   } catch (DapException de) {
     return false;
   }
   this.current = null;
   return false;
 }