/**
 * 
 */
package org.getopt.luke;

import java.util.ArrayList;

import org.apache.lucene.search.HitCollector;

class AllHitsCollector extends AccessibleHitCollector {
  private ArrayList hits = new ArrayList();
  
  public AllHitsCollector() {
  }
  
  public void collect(int doc, float score) {
    hits.add(new AllHit(doc, score));
  }
  
  public int getTotalHits() {
    return hits.size();
  }
  
  public int getDocId(int i) {
    return ((AllHitsCollector.AllHit)hits.get(i)).docId;
  }

  public float getScore(int i) {
    return ((AllHitsCollector.AllHit)hits.get(i)).score;
  }

  private static class AllHit {
    public int docId;
    public float score;
    
    public AllHit(int docId, float score) {
      this.docId = docId;
      this.score = score;
    }
  }
}