Example #1
0
 public static void main(String[] argv) {
   try {
     MatchData md = new MatchData(argv[0]);
     System.out.println("Dump:");
     System.out.println(md.toString());
     System.out.println();
     System.out.println("Iteration:");
     for (Iterator i = md.getIterator(); i.hasNext(); ) {
       System.out.println(i.next().toString());
     }
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
Example #2
0
 /** Returns the next StringWrapper as an object. */
 public Object next() {
   Instance inst = data.getInstance(src, instanceCursor++);
   if (KEEP_OLD_ITERATION_BUG && instanceCursor > data.numInstances(src)) {
     sourceCursor++;
     instanceCursor = 0;
     if (sourceCursor < data.numSources()) src = data.getSource(sourceCursor);
   }
   if (!KEEP_OLD_ITERATION_BUG && instanceCursor >= data.numInstances(src)) {
     sourceCursor++;
     instanceCursor = 0;
     if (sourceCursor < data.numSources()) src = data.getSource(sourceCursor);
   }
   return inst;
 }
Example #3
0
 public boolean hasNext() {
   return sourceCursor < data.numSources() && instanceCursor < data.numInstances(src);
 }
Example #4
0
 public MatchIterator(MatchData data) {
   this.data = data;
   sourceCursor = 0;
   instanceCursor = 0;
   src = data.getSource(sourceCursor);
 }