lucene-core-2.9.4-dev

etBottom(bottom.slot);
      }
    }
    else
    {
      int slot = totalHits - 1;
      for (int i = 0; i < comparators.length; i++) {
        comparators[i].copy(slot, doc);
      }
      add(slot, doc, NaN.0F);
      if (queueFull) {
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].setBottom(bottom.slot);
        }
      }
    }
  }
  
  public boolean acceptsDocsOutOfOrder()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopFieldCollector.OutOfOrderMultiComparatorNonScoringCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;

final class TopFieldCollector$OutOfOrderMultiComparatorScoringMaxScoreCollector
  extends TopFieldCollector.MultiComparatorScoringMaxScoreCollector
{
  public TopFieldCollector$OutOfOrderMultiComparatorScoringMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
    throws IOException
  {
    super(queue, numHits, fillFields);
  }
  
  public void collect(int doc)
    throws IOException
  {
    float score = scorer.score();
    if (score > maxScore) {
      maxScore = score;
    }
    totalHits += 1;
    if (queueFull)
    {
      for (int i = 0;; i++)
      {
        int c = reverseMul[i] * comparators[i].compareBottom(doc);
        if (c < 0) {
          return;
        }
        if (c > 0) {
          break;
        }
        if (i == comparators.length - 1)
        {
          if (doc + docBase <= bottom.docID) {
            break;
          }
          return;
        }
      }
      for (int i = 0; i < comparators.length; i++) {
        comparators[i].copy(bottom.slot, doc);
      }
      updateBottom(doc, score);
      for (int i = 0; i < comparators.length; i++) {
        comparators[i].setBottom(bottom.slot);
      }
    }
    else
    {
      int slot = totalHits - 1;
      for (int i = 0; i < comparators.length; i++) {
        comparators[i].copy(slot, doc);
      }
      add(slot, doc, score);
      if (queueFull) {
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].setBottom(bottom.slot);
        }
      }
    }
  }
  
  public boolean acceptsDocsOutOfOrder()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopFieldCollector.OutOfOrderMultiComparatorScoringMaxScoreCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;

final class TopFieldCollector$OutOfOrderMultiComparatorScoringNoMaxScoreCollector
  extends TopFieldCollector.MultiComparatorScoringNoMaxScoreCollector
{
  public TopFieldCollector$OutOfOrderMultiComparatorScoringNoMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
    throws IOException
  {
    super(queue, numHits, fillFields);
  }
  
  public void collect(int doc)
    throws IOException
  {
    totalHits += 1;
    if (queueFull)
    {
      for (int i = 0;; i++)
      {
        int c = reverseMul[i] * comparators[i].compareBottom(doc);
        if (c < 0) {
          return;
        }
        if (c > 0) {
          break;
        }
        if (i == comparators.length - 1)
        {
          if (doc + docBase <= bottom.docID) {
            break;
          }
          return;
        }
      }
      for (int i = 0; i < comparators.length; i++) {
        comparators[i].copy(bottom.slot, doc);
      }
      float score = scorer.score();
      updateBottom(doc, score);
      for (int i = 0; i < comparators.length; i++) {
        comparators[i].setBottom(bottom.slot);
      }
    }
    else
    {
      int slot = totalHits - 1;
      for (int i = 0; i < comparators.length; i++) {
        comparators[i].copy(slot, doc);
      }
      float score = scorer.score();
      add(slot, doc, score);
      if (queueFull) {
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].setBottom(bottom.slot);
        }
      }
    }
  }
  
  public void setScorer(Scorer scorer)
    throws IOException
  {
    this.scorer = scorer;
    super.setScorer(scorer);
  }
  
  public boolean acceptsDocsOutOfOrder()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopFieldCollector.OutOfOrderMultiComparatorScoringNoMaxScoreCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;

class TopFieldCollector$OutOfOrderOneComparatorNonScoringCollector
  extends TopFieldCollector.OneComparatorNonScoringCollector
{
  public TopFieldCollector$OutOfOrderOneComparatorNonScoringCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
    throws IOException
  {
    super(queue, numHits, fillFields);
  }
  
  public void collect(int doc)
    throws IOException
  {
    totalHits += 1;
    if (queueFull)
    {
      int cmp = reverseMul * comparator.compareBottom(doc);
      if ((cmp < 0) || ((cmp == 0) && (doc + docBase > bottom.docID))) {
        return;
      }
      comparator.copy(bottom.slot, doc);
      updateBottom(doc);
      comparator.setBottom(bottom.slot);
    }
    else
    {
      int slot = totalHits - 1;
      
      comparator.copy(slot, doc);
      add(slot, doc, NaN.0F);
      if (queueFull) {
        comparator.setBottom(bottom.slot);
      }
    }
  }
  
  public boolean acceptsDocsOutOfOrder()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopFieldCollector.OutOfOrderOneComparatorNonScoringCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;

class TopFieldCollector$OutOfOrderOneComparatorScoringMaxScoreCollector
  extends TopFieldCollector.OneComparatorScoringMaxScoreCollector
{
  public TopFieldCollector$OutOfOrderOneComparatorScoringMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
    throws IOException
  {
    super(queue, numHits, fillFields);
  }
  
  public void collect(int doc)
    throws IOException
  {
    float score = scorer.score();
    if (score > maxScore) {
      maxScore = score;
    }
    totalHits += 1;
    if (queueFull)
    {
      int cmp = reverseMul * comparator.compareBottom(doc);
      if ((cmp < 0) || ((cmp == 0) && (doc + docBase > bottom.docID))) {
        return;
      }
      comparator.copy(bottom.slot, doc);
      updateBottom(doc, score);
      comparator.setBottom(bottom.slot);
    }
    else
    {
      int slot = totalHits - 1;
      
      comparator.copy(slot, doc);
      add(slot, doc, score);
      if (queueFull) {
        comparator.setBottom(bottom.slot);
      }
    }
  }
  
  public boolean acceptsDocsOutOfOrder()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopFieldCollector.OutOfOrderOneComparatorScoringMaxScoreCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;

class TopFieldCollector$OutOfOrderOneComparatorScoringNoMaxScoreCollector
  extends TopFieldCollector.OneComparatorScoringNoMaxScoreCollector
{
  public TopFieldCollector$OutOfOrderOneComparatorScoringNoMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
    throws IOException
  {
    super(queue, numHits, fillFields);
  }
  
  public void collect(int doc)
    throws IOException
  {
    totalHits += 1;
    if (queueFull)
    {
      int cmp = reverseMul * comparator.compareBottom(doc);
      if ((cmp < 0) || ((cmp == 0) && (doc + docBase > bottom.docID))) {
        return;
      }
      float score = scorer.score();
      
      comparator.copy(bottom.slot, doc);
      updateBottom(doc, score);
      comparator.setBottom(bottom.slot);
    }
    else
    {
      float score = scorer.score();
      
      int slot = totalHits - 1;
      
      comparator.copy(slot, doc);
      add(slot, doc, score);
      if (queueFull) {
        comparator.setBottom(bottom.slot);
      }
    }
  }
  
  public boolean acceptsDocsOutOfOrder()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopFieldCollector.OutOfOrderOneComparatorScoringNoMaxScoreCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.util.PriorityQueue;

public abstract class TopFieldCollector
  extends TopDocsCollector
{
  TopFieldCollector(PriorityQueue x0, int x1, boolean x2, 1 x3)
  {
    this(x0, x1, x2);
  }
  
  private static class OneComparatorNonScoringCollector
    extends TopFieldCollector
  {
    final FieldComparator comparator;
    final int reverseMul;
    
    public OneComparatorNonScoringCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields, null);
      comparator = queue.getComparators()[0];
      reverseMul = queue.getReverseMul()[0];
    }
    
    final void updateBottom(int doc)
    {
      bottom.docID = (docBase + doc);
      bottom = ((FieldValueHitQueue.Entry)pq.updateTop());
    }
    
    public void collect(int doc)
      throws IOException
    {
      totalHits += 1;
      if (queueFull)
      {
        if (reverseMul * comparator.compareBottom(doc) <= 0) {
          return;
        }
        comparator.copy(bottom.slot, doc);
        updateBottom(doc);
        comparator.setBottom(bottom.slot);
      }
      else
      {
        int slot = totalHits - 1;
        
        comparator.copy(slot, doc);
        add(slot, doc, NaN.0F);
        if (queueFull) {
          comparator.setBottom(bottom.slot);
        }
      }
    }
    
    public void setNextReader(IndexReader reader, int docBase)
      throws IOException
    {
      this.docBase = docBase;
      comparator.setNextReader(reader, docBase);
    }
    
    public void setScorer(Scorer scorer)
      throws IOException
    {
      comparator.setScorer(scorer);
    }
  }
  
  private static class OutOfOrderOneComparatorNonScoringCollector
    extends TopFieldCollector.OneComparatorNonScoringCollector
  {
    public OutOfOrderOneComparatorNonScoringCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
    }
    
    public void collect(int doc)
      throws IOException
    {
      totalHits += 1;
      if (queueFull)
      {
        int cmp = reverseMul * comparator.compareBottom(doc);
        if ((cmp < 0) || ((cmp == 0) && (doc + docBase > bottom.docID))) {
          return;
        }
        comparator.copy(bottom.slot, doc);
        updateBottom(doc);
        comparator.setBottom(bottom.slot);
      }
      else
      {
        int slot = totalHits - 1;
        
        comparator.copy(slot, doc);
        add(slot, doc, NaN.0F);
        if (queueFull) {
          comparator.setBottom(bottom.slot);
        }
      }
    }
    
    public boolean acceptsDocsOutOfOrder()
    {
      return true;
    }
  }
  
  private static class OneComparatorScoringNoMaxScoreCollector
    extends TopFieldCollector.OneComparatorNonScoringCollector
  {
    Scorer scorer;
    
    public OneComparatorScoringNoMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
    }
    
    final void updateBottom(int doc, float score)
    {
      bottom.docID = (docBase + doc);
      bottom.score = score;
      bottom = ((FieldValueHitQueue.Entry)pq.updateTop());
    }
    
    public void collect(int doc)
      throws IOException
    {
      totalHits += 1;
      if (queueFull)
      {
        if (reverseMul * comparator.compareBottom(doc) <= 0) {
          return;
        }
        float score = scorer.score();
        
        comparator.copy(bottom.slot, doc);
        updateBottom(doc, score);
        comparator.setBottom(bottom.slot);
      }
      else
      {
        float score = scorer.score();
        
        int slot = totalHits - 1;
        
        comparator.copy(slot, doc);
        add(slot, doc, score);
        if (queueFull) {
          comparator.setBottom(bottom.slot);
        }
      }
    }
    
    public void setScorer(Scorer scorer)
      throws IOException
    {
      this.scorer = scorer;
      comparator.setScorer(scorer);
    }
  }
  
  private static class OutOfOrderOneComparatorScoringNoMaxScoreCollector
    extends TopFieldCollector.OneComparatorScoringNoMaxScoreCollector
  {
    public OutOfOrderOneComparatorScoringNoMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
    }
    
    public void collect(int doc)
      throws IOException
    {
      totalHits += 1;
      if (queueFull)
      {
        int cmp = reverseMul * comparator.compareBottom(doc);
        if ((cmp < 0) || ((cmp == 0) && (doc + docBase > bottom.docID))) {
          return;
        }
        float score = scorer.score();
        
        comparator.copy(bottom.slot, doc);
        updateBottom(doc, score);
        comparator.setBottom(bottom.slot);
      }
      else
      {
        float score = scorer.score();
        
        int slot = totalHits - 1;
        
        comparator.copy(slot, doc);
        add(slot, doc, score);
        if (queueFull) {
          comparator.setBottom(bottom.slot);
        }
      }
    }
    
    public boolean acceptsDocsOutOfOrder()
    {
      return true;
    }
  }
  
  private static class OneComparatorScoringMaxScoreCollector
    extends TopFieldCollector.OneComparatorNonScoringCollector
  {
    Scorer scorer;
    
    public OneComparatorScoringMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
      
      maxScore = Float.NEGATIVE_INFINITY;
    }
    
    final void updateBottom(int doc, float score)
    {
      bottom.docID = (docBase + doc);
      bottom.score = score;
      bottom = ((FieldValueHitQueue.Entry)pq.updateTop());
    }
    
    public void collect(int doc)
      throws IOException
    {
      float score = scorer.score();
      if (score > maxScore) {
        maxScore = score;
      }
      totalHits += 1;
      if (queueFull)
      {
        if (reverseMul * comparator.compareBottom(doc) <= 0) {
          return;
        }
        comparator.copy(bottom.slot, doc);
        updateBottom(doc, score);
        comparator.setBottom(bottom.slot);
      }
      else
      {
        int slot = totalHits - 1;
        
        comparator.copy(slot, doc);
        add(slot, doc, score);
        if (queueFull) {
          comparator.setBottom(bottom.slot);
        }
      }
    }
    
    public void setScorer(Scorer scorer)
      throws IOException
    {
      this.scorer = scorer;
      super.setScorer(scorer);
    }
  }
  
  private static class OutOfOrderOneComparatorScoringMaxScoreCollector
    extends TopFieldCollector.OneComparatorScoringMaxScoreCollector
  {
    public OutOfOrderOneComparatorScoringMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
    }
    
    public void collect(int doc)
      throws IOException
    {
      float score = scorer.score();
      if (score > maxScore) {
        maxScore = score;
      }
      totalHits += 1;
      if (queueFull)
      {
        int cmp = reverseMul * comparator.compareBottom(doc);
        if ((cmp < 0) || ((cmp == 0) && (doc + docBase > bottom.docID))) {
          return;
        }
        comparator.copy(bottom.slot, doc);
        updateBottom(doc, score);
        comparator.setBottom(bottom.slot);
      }
      else
      {
        int slot = totalHits - 1;
        
        comparator.copy(slot, doc);
        add(slot, doc, score);
        if (queueFull) {
          comparator.setBottom(bottom.slot);
        }
      }
    }
    
    public boolean acceptsDocsOutOfOrder()
    {
      return true;
    }
  }
  
  private static class MultiComparatorNonScoringCollector
    extends TopFieldCollector
  {
    final FieldComparator[] comparators;
    final int[] reverseMul;
    
    public MultiComparatorNonScoringCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields, null);
      comparators = queue.getComparators();
      reverseMul = queue.getReverseMul();
    }
    
    final void updateBottom(int doc)
    {
      bottom.docID = (docBase + doc);
      bottom = ((FieldValueHitQueue.Entry)pq.updateTop());
    }
    
    public void collect(int doc)
      throws IOException
    {
      totalHits += 1;
      if (queueFull)
      {
        for (int i = 0;; i++)
        {
          int c = reverseMul[i] * comparators[i].compareBottom(doc);
          if (c < 0) {
            return;
          }
          if (c > 0) {
            break;
          }
          if (i == comparators.length - 1) {
            return;
          }
        }
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(bottom.slot, doc);
        }
        updateBottom(doc);
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].setBottom(bottom.slot);
        }
      }
      else
      {
        int slot = totalHits - 1;
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(slot, doc);
        }
        add(slot, doc, NaN.0F);
        if (queueFull) {
          for (int i = 0; i < comparators.length; i++) {
            comparators[i].setBottom(bottom.slot);
          }
        }
      }
    }
    
    public void setNextReader(IndexReader reader, int docBase)
      throws IOException
    {
      this.docBase = docBase;
      for (int i = 0; i < comparators.length; i++) {
        comparators[i].setNextReader(reader, docBase);
      }
    }
    
    public void setScorer(Scorer scorer)
      throws IOException
    {
      for (int i = 0; i < comparators.length; i++) {
        comparators[i].setScorer(scorer);
      }
    }
  }
  
  private static class OutOfOrderMultiComparatorNonScoringCollector
    extends TopFieldCollector.MultiComparatorNonScoringCollector
  {
    public OutOfOrderMultiComparatorNonScoringCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
    }
    
    public void collect(int doc)
      throws IOException
    {
      totalHits += 1;
      if (queueFull)
      {
        for (int i = 0;; i++)
        {
          int c = reverseMul[i] * comparators[i].compareBottom(doc);
          if (c < 0) {
            return;
          }
          if (c > 0) {
            break;
          }
          if (i == comparators.length - 1)
          {
            if (doc + docBase <= bottom.docID) {
              break;
            }
            return;
          }
        }
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(bottom.slot, doc);
        }
        updateBottom(doc);
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].setBottom(bottom.slot);
        }
      }
      else
      {
        int slot = totalHits - 1;
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(slot, doc);
        }
        add(slot, doc, NaN.0F);
        if (queueFull) {
          for (int i = 0; i < comparators.length; i++) {
            comparators[i].setBottom(bottom.slot);
          }
        }
      }
    }
    
    public boolean acceptsDocsOutOfOrder()
    {
      return true;
    }
  }
  
  private static class MultiComparatorScoringMaxScoreCollector
    extends TopFieldCollector.MultiComparatorNonScoringCollector
  {
    Scorer scorer;
    
    public MultiComparatorScoringMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
      
      maxScore = Float.NEGATIVE_INFINITY;
    }
    
    final void updateBottom(int doc, float score)
    {
      bottom.docID = (docBase + doc);
      bottom.score = score;
      bottom = ((FieldValueHitQueue.Entry)pq.updateTop());
    }
    
    public void collect(int doc)
      throws IOException
    {
      float score = scorer.score();
      if (score > maxScore) {
        maxScore = score;
      }
      totalHits += 1;
      if (queueFull)
      {
        for (int i = 0;; i++)
        {
          int c = reverseMul[i] * comparators[i].compareBottom(doc);
          if (c < 0) {
            return;
          }
          if (c > 0) {
            break;
          }
          if (i == comparators.length - 1) {
            return;
          }
        }
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(bottom.slot, doc);
        }
        updateBottom(doc, score);
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].setBottom(bottom.slot);
        }
      }
      else
      {
        int slot = totalHits - 1;
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(slot, doc);
        }
        add(slot, doc, score);
        if (queueFull) {
          for (int i = 0; i < comparators.length; i++) {
            comparators[i].setBottom(bottom.slot);
          }
        }
      }
    }
    
    public void setScorer(Scorer scorer)
      throws IOException
    {
      this.scorer = scorer;
      super.setScorer(scorer);
    }
  }
  
  private static final class OutOfOrderMultiComparatorScoringMaxScoreCollector
    extends TopFieldCollector.MultiComparatorScoringMaxScoreCollector
  {
    public OutOfOrderMultiComparatorScoringMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
    }
    
    public void collect(int doc)
      throws IOException
    {
      float score = scorer.score();
      if (score > maxScore) {
        maxScore = score;
      }
      totalHits += 1;
      if (queueFull)
      {
        for (int i = 0;; i++)
        {
          int c = reverseMul[i] * comparators[i].compareBottom(doc);
          if (c < 0) {
            return;
          }
          if (c > 0) {
            break;
          }
          if (i == comparators.length - 1)
          {
            if (doc + docBase <= bottom.docID) {
              break;
            }
            return;
          }
        }
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(bottom.slot, doc);
        }
        updateBottom(doc, score);
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].setBottom(bottom.slot);
        }
      }
      else
      {
        int slot = totalHits - 1;
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(slot, doc);
        }
        add(slot, doc, score);
        if (queueFull) {
          for (int i = 0; i < comparators.length; i++) {
            comparators[i].setBottom(bottom.slot);
          }
        }
      }
    }
    
    public boolean acceptsDocsOutOfOrder()
    {
      return true;
    }
  }
  
  private static class MultiComparatorScoringNoMaxScoreCollector
    extends TopFieldCollector.MultiComparatorNonScoringCollector
  {
    Scorer scorer;
    
    public MultiComparatorScoringNoMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
    }
    
    final void updateBottom(int doc, float score)
    {
      bottom.docID = (docBase + doc);
      bottom.score = score;
      bottom = ((FieldValueHitQueue.Entry)pq.updateTop());
    }
    
    public void collect(int doc)
      throws IOException
    {
      totalHits += 1;
      if (queueFull)
      {
        for (int i = 0;; i++)
        {
          int c = reverseMul[i] * comparators[i].compareBottom(doc);
          if (c < 0) {
            return;
          }
          if (c > 0) {
            break;
          }
          if (i == comparators.length - 1) {
            return;
          }
        }
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(bottom.slot, doc);
        }
        float score = scorer.score();
        updateBottom(doc, score);
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].setBottom(bottom.slot);
        }
      }
      else
      {
        int slot = totalHits - 1;
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(slot, doc);
        }
        float score = scorer.score();
        add(slot, doc, score);
        if (queueFull) {
          for (int i = 0; i < comparators.length; i++) {
            comparators[i].setBottom(bottom.slot);
          }
        }
      }
    }
    
    public void setScorer(Scorer scorer)
      throws IOException
    {
      this.scorer = scorer;
      super.setScorer(scorer);
    }
  }
  
  private static final class OutOfOrderMultiComparatorScoringNoMaxScoreCollector
    extends TopFieldCollector.MultiComparatorScoringNoMaxScoreCollector
  {
    public OutOfOrderMultiComparatorScoringNoMaxScoreCollector(FieldValueHitQueue queue, int numHits, boolean fillFields)
      throws IOException
    {
      super(numHits, fillFields);
    }
    
    public void collect(int doc)
      throws IOException
    {
      totalHits += 1;
      if (queueFull)
      {
        for (int i = 0;; i++)
        {
          int c = reverseMul[i] * comparators[i].compareBottom(doc);
          if (c < 0) {
            return;
          }
          if (c > 0) {
            break;
          }
          if (i == comparators.length - 1)
          {
            if (doc + docBase <= bottom.docID) {
              break;
            }
            return;
          }
        }
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(bottom.slot, doc);
        }
        float score = scorer.score();
        updateBottom(doc, score);
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].setBottom(bottom.slot);
        }
      }
      else
      {
        int slot = totalHits - 1;
        for (int i = 0; i < comparators.length; i++) {
          comparators[i].copy(slot, doc);
        }
        float score = scorer.score();
        add(slot, doc, score);
        if (queueFull) {
          for (int i = 0; i < comparators.length; i++) {
            comparators[i].setBottom(bottom.slot);
          }
        }
      }
    }
    
    public void setScorer(Scorer scorer)
      throws IOException
    {
      this.scorer = scorer;
      super.setScorer(scorer);
    }
    
    public boolean acceptsDocsOutOfOrder()
    {
      return true;
    }
  }
  
  private static final ScoreDoc[] EMPTY_SCOREDOCS = new ScoreDoc[0];
  private final boolean fillFields;
  float maxScore = NaN.0F;
  final int numHits;
  FieldValueHitQueue.Entry bottom = null;
  boolean queueFull;
  int docBase;
  
  private TopFieldCollector(PriorityQueue pq, int numHits, boolean fillFields)
  {
    super(pq);
    this.numHits = numHits;
    this.fillFields = fillFields;
  }
  
  public static TopFieldCollector create(Sort sort, int numHits, boolean fillFields, boolean trackDocScores, boolean trackMaxScore, boolean docsScoredInOrder)
    throws IOException
  {
    if (fields.length == 0) {
      throw new IllegalArgumentException("Sort must contain at least one field");
    }
    FieldValueHitQueue queue = FieldValueHitQueue.create(fields, numHits);
    if (queue.getComparators().length == 1)
    {
      if (docsScoredInOrder)
      {
        if (trackMaxScore) {
          return new OneComparatorScoringMaxScoreCollector(queue, numHits, fillFields);
        }
        if (trackDocScores) {
          return new OneComparatorScoringNoMaxScoreCollector(queue, numHits, fillFields);
        }
        return new OneComparatorNonScoringCollector(queue, numHits, fillFields);
      }
      if (trackMaxScore) {
        return new OutOfOrderOneComparatorScoringMaxScoreCollector(queue, numHits, fillFields);
      }
      if (trackDocScores) {
        return new OutOfOrderOneComparatorScoringNoMaxScoreCollector(queue, numHits, fillFields);
      }
      return new OutOfOrderOneComparatorNonScoringCollector(queue, numHits, fillFields);
    }
    if (docsScoredInOrder)
    {
      if (trackMaxScore) {
        return new MultiComparatorScoringMaxScoreCollector(queue, numHits, fillFields);
      }
      if (trackDocScores) {
        return new MultiComparatorScoringNoMaxScoreCollector(queue, numHits, fillFields);
      }
      return new MultiComparatorNonScoringCollector(queue, numHits, fillFields);
    }
    if (trackMaxScore) {
      return new OutOfOrderMultiComparatorScoringMaxScoreCollector(queue, numHits, fillFields);
    }
    if (trackDocScores) {
      return new OutOfOrderMultiComparatorScoringNoMaxScoreCollector(queue, numHits, fillFields);
    }
    return new OutOfOrderMultiComparatorNonScoringCollector(queue, numHits, fillFields);
  }
  
  final void add(int slot, int doc, float score)
  {
    bottom = ((FieldValueHitQueue.Entry)pq.add(new FieldValueHitQueue.Entry(slot, docBase + doc, score)));
    queueFull = (totalHits == numHits);
  }
  
  protected void populateResults(ScoreDoc[] results, int howMany)
  {
    if (fillFields)
    {
      FieldValueHitQueue queue = (FieldValueHitQueue)pq;
      for (int i = howMany - 1; i >= 0; i--) {
        results[i] = queue.fillFields((FieldValueHitQueue.Entry)queue.pop());
      }
    }
    else
    {
      for (int i = howMany - 1; i >= 0; i--)
      {
        FieldValueHitQueue.Entry entry = (FieldValueHitQueue.Entry)pq.pop();
        results[i] = new FieldDoc(docID, score);
      }
    }
  }
  
  protected TopDocs newTopDocs(ScoreDoc[] results, int start)
  {
    if (results == null)
    {
      results = EMPTY_SCOREDOCS;
      
      maxScore = NaN.0F;
    }
    return new TopFieldDocs(totalHits, results, ((FieldValueHitQueue)pq).getFields(), maxScore);
  }
  
  public boolean acceptsDocsOutOfOrder()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopFieldCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.util.PriorityQueue;

/**
 * @deprecated
 */
public class TopFieldDocCollector
  extends TopDocCollector
{
  private FieldDoc reusableFD;
  
  public TopFieldDocCollector(IndexReader reader, Sort sort, int numHits)
    throws IOException
  {
    super(new FieldSortedHitQueue(reader, fields, numHits));
  }
  
  public void collect(int doc, float score)
  {
    if (score > 0.0F)
    {
      totalHits += 1;
      if (reusableFD == null)
      {
        reusableFD = new FieldDoc(doc, score);
      }
      else
      {
        reusableFD.score = score;
        reusableFD.doc = doc;
      }
      reusableFD = ((FieldDoc)hq.insertWithOverflow(reusableFD));
    }
  }
  
  public TopDocs topDocs()
  {
    FieldSortedHitQueue fshq = (FieldSortedHitQueue)hq;
    ScoreDoc[] scoreDocs = new ScoreDoc[fshq.size()];
    for (int i = fshq.size() - 1; i >= 0; i--) {
      scoreDocs[i] = fshq.fillFields((FieldDoc)fshq.pop());
    }
    return new TopFieldDocs(totalHits, scoreDocs, fshq.getFields(), fshq.getMaxScore());
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopFieldDocCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

public class TopFieldDocs
  extends TopDocs
{
  public SortField[] fields;
  
  public TopFieldDocs(int totalHits, ScoreDoc[] scoreDocs, SortField[] fields, float maxScore)
  {
    super(totalHits, scoreDocs, maxScore);
    this.fields = fields;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopFieldDocs
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

class TopScoreDocCollector$1 {}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopScoreDocCollector.1
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;
import org.apache.lucene.util.PriorityQueue;

class TopScoreDocCollector$InOrderTopScoreDocCollector
  extends TopScoreDocCollector
{
  TopScoreDocCollector$InOrderTopScoreDocCollector(int x0, TopScoreDocCollector.1 x1)
  {
    this(x0);
  }
  
  private TopScoreDocCollector$InOrderTopScoreDocCollector(int numHits)
  {
    super(numHits, null);
  }
  
  public void collect(int doc)
    throws IOException
  {
    float score = scorer.score();
    
    assert (score != Float.NEGATIVE_INFINITY);
    assert (!Float.isNaN(score));
    
    totalHits += 1;
    if (score <= pqTop.score) {
      return;
    }
    pqTop.doc = (doc + docBase);
    pqTop.score = score;
    pqTop = ((ScoreDoc)pq.updateTop());
  }
  
  public boolean acceptsDocsOutOfOrder()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopScoreDocCollector.InOrderTopScoreDocCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;
import org.apache.lucene.util.PriorityQueue;

class TopScoreDocCollector$OutOfOrderTopScoreDocCollector
  extends TopScoreDocCollector
{
  TopScoreDocCollector$OutOfOrderTopScoreDocCollector(int x0, TopScoreDocCollector.1 x1)
  {
    this(x0);
  }
  
  private TopScoreDocCollector$OutOfOrderTopScoreDocCollector(int numHits)
  {
    super(numHits, null);
  }
  
  public void collect(int doc)
    throws IOException
  {
    float score = scorer.score();
    
    assert (!Float.isNaN(score));
    
    totalHits += 1;
    doc += docBase;
    if ((score < pqTop.score) || ((score == pqTop.score) && (doc > pqTop.doc))) {
      return;
    }
    pqTop.doc = doc;
    pqTop.score = score;
    pqTop = ((ScoreDoc)pq.updateTop());
  }
  
  public boolean acceptsDocsOutOfOrder()
  {
    return true;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopScoreDocCollector.OutOfOrderTopScoreDocCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.util.PriorityQueue;

public abstract class TopScoreDocCollector
  extends TopDocsCollector
{
  ScoreDoc pqTop;
  
  TopScoreDocCollector(int x0, 1 x1)
  {
    this(x0);
  }
  
  private static class InOrderTopScoreDocCollector
    extends TopScoreDocCollector
  {
    InOrderTopScoreDocCollector(int x0, TopScoreDocCollector.1 x1)
    {
      this(x0);
    }
    
    private InOrderTopScoreDocCollector(int numHits)
    {
      super(null);
    }
    
    public void collect(int doc)
      throws IOException
    {
      float score = scorer.score();
      
      assert (score != Float.NEGATIVE_INFINITY);
      assert (!Float.isNaN(score));
      
      totalHits += 1;
      if (score <= pqTop.score) {
        return;
      }
      pqTop.doc = (doc + docBase);
      pqTop.score = score;
      pqTop = ((ScoreDoc)pq.updateTop());
    }
    
    public boolean acceptsDocsOutOfOrder()
    {
      return false;
    }
  }
  
  private static class OutOfOrderTopScoreDocCollector
    extends TopScoreDocCollector
  {
    OutOfOrderTopScoreDocCollector(int x0, TopScoreDocCollector.1 x1)
    {
      this(x0);
    }
    
    private OutOfOrderTopScoreDocCollector(int numHits)
    {
      super(null);
    }
    
    public void collect(int doc)
      throws IOException
    {
      float score = scorer.score();
      
      assert (!Float.isNaN(score));
      
      totalHits += 1;
      doc += docBase;
      if ((score < pqTop.score) || ((score == pqTop.score) && (doc > pqTop.doc))) {
        return;
      }
      pqTop.doc = doc;
      pqTop.score = score;
      pqTop = ((ScoreDoc)pq.updateTop());
    }
    
    public boolean acceptsDocsOutOfOrder()
    {
      return true;
    }
  }
  
  public static TopScoreDocCollector create(int numHits, boolean docsScoredInOrder)
  {
    if (docsScoredInOrder) {
      return new InOrderTopScoreDocCollector(numHits, null);
    }
    return new OutOfOrderTopScoreDocCollector(numHits, null);
  }
  
  int docBase = 0;
  Scorer scorer;
  
  private TopScoreDocCollector(int numHits)
  {
    super(new HitQueue(numHits, true));
    
    pqTop = ((ScoreDoc)pq.top());
  }
  
  protected TopDocs newTopDocs(ScoreDoc[] results, int start)
  {
    if (results == null) {
      return EMPTY_TOPDOCS;
    }
    float maxScore = NaN.0F;
    if (start == 0)
    {
      maxScore = 0score;
    }
    else
    {
      for (int i = pq.size(); i > 1; i--) {
        pq.pop();
      }
      maxScore = pq.pop()).score;
    }
    return new TopDocs(totalHits, results, maxScore);
  }
  
  public void setNextReader(IndexReader reader, int base)
  {
    docBase = base;
  }
  
  public void setScorer(Scorer scorer)
    throws IOException
  {
    this.scorer = scorer;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.TopScoreDocCollector
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;
import java.io.Serializable;
import org.apache.lucene.index.IndexReader;

public abstract class Weight
  implements Serializable
{
  public abstract Explanation explain(IndexReader paramIndexReader, int paramInt)
    throws IOException;
  
  public abstract Query getQuery();
  
  public abstract float getValue();
  
  public abstract void normalize(float paramFloat);
  
  public abstract Scorer scorer(IndexReader paramIndexReader, boolean paramBoolean1, boolean paramBoolean2)
    throws IOException;
  
  public abstract float sumOfSquaredWeights()
    throws IOException;
  
  public boolean scoresDocsOutOfOrder()
  {
    return false;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.Weight
 * Java Class Version: 1.4 (48.0)
 * JD-Core Version:    0.7.1
 */
package org.apache.lucene.search;

import java.io.IOException;
import org.apache.lucene.index.IndexReader;
import org.apache.lucene.index.Term;
import org.apache.lucene.util.ToStringUtils;

public class WildcardQuery
  extends MultiTermQuery
{
  private boolean termContainsWildcard;
  protected Term term;
  
  public WildcardQuery(Term term)
  {
    super(term);
    this.term = term;
    termContainsWildcard = ((term.text().indexOf('*') != -1) || (term.text().indexOf('?') != -1));
  }
  
  protected FilteredTermEnum getEnum(IndexReader reader)
    throws IOException
  {
    return new WildcardTermEnum(reader, getTerm());
  }
  
  public Term getTerm()
  {
    return term;
  }
  
  public Query rewrite(IndexReader reader)
    throws IOException
  {
    if (!termContainsWildcard) {
      return new TermQuery(getTerm());
    }
    return super.rewrite(reader);
  }
  
  public String toString(String field)
  {
    StringBuffer buffer = new StringBuffer();
    if (!term.field().equals(field))
    {
      buffer.append(term.field());
      buffer.append(":");
    }
    buffer.append(term.text());
    buffer.append(ToStringUtils.boost(getBoost()));
    return buffer.toString();
  }
  
  public int hashCode()
  {
    int prime = 31;
    int result = super.hashCode();
    result = 31 * result + (term == null ? 0 : term.hashCode());
    return result;
  }
  
  public boolean equals(Object obj)
  {
    if (this == obj) {
      return true;
    }
    if (!super.equals(obj)) {
      return false;
    }
    if (getClass() != obj.getClass()) {
      return false;
    }
    WildcardQuery other = (WildcardQuery)obj;
    if 
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd