lucene-core-2.9.4-dev

Reader reader, FieldCacheImpl.Entry entryKey)
      throws IOException
    {
      String field = StringHelper.intern(field);
      int[] retArray = new int[reader.maxDoc()];
      String[] mterms = new String[reader.maxDoc() + 1];
      TermDocs termDocs = reader.termDocs();
      TermEnum termEnum = reader.terms(new Term(field));
      int t = 0;
      
      mterms[(t++)] = null;
      try
      {
        do
        {
          Term term = termEnum.term();
          if ((term == null) || (term.field() != field) || (t >= mterms.length)) {
            break;
          }
          mterms[t] = term.text();
          
          termDocs.seek(termEnum);
          while (termDocs.next()) {
            retArray[termDocs.doc()] = t;
          }
          t++;
        } while (termEnum.next());
      }
      finally
      {
        termDocs.close();
        termEnum.close();
      }
      if (t == 0)
      {
        mterms = new String[1];
      }
      else if (t < mterms.length)
      {
        String[] terms = new String[t];
        System.arraycopy(mterms, 0, terms, 0, t);
        mterms = terms;
      }
      FieldCache.StringIndex value = new FieldCache.StringIndex(retArray, mterms);
      return value;
    }
  }
  
  public Object getAuto(IndexReader reader, String field)
    throws IOException
  {
    return ((Cache)caches.get(Object.class)).get(reader, new Entry(field, (FieldCache.Parser)null));
  }
  
  /**
   * @deprecated
   */
  static final class AutoCache
    extends FieldCacheImpl.Cache
  {
    AutoCache(FieldCache wrapper)
    {
      super();
    }
    
    protected Object createValue(IndexReader reader, FieldCacheImpl.Entry entryKey)
      throws IOException
    {
      String field = StringHelper.intern(field);
      TermEnum enumerator = reader.terms(new Term(field));
      try
      {
        Term term = enumerator.term();
        if (term == null) {
          throw new RuntimeException("no terms in field " + field + " - cannot determine type");
        }
        Object ret = null;
        String termtext;
        if (term.field() == field)
        {
          termtext = term.text().trim();
          try
          {
            Integer.parseInt(termtext);
            ret = wrapper.getInts(reader, field);
          }
          catch (NumberFormatException nfe1)
          {
            try
            {
              Long.parseLong(termtext);
              ret = wrapper.getLongs(reader, field);
            }
            catch (NumberFormatException nfe2)
            {
              try
              {
                Float.parseFloat(termtext);
                ret = wrapper.getFloats(reader, field);
              }
              catch (NumberFormatException nfe3)
              {
                ret = wrapper.getStringIndex(reader, field);
              }
            }
          }
        }
        else
        {
          throw new RuntimeException("field \"" + field + "\" does not appear to be indexed");
        }
        return (String)ret;
      }
      finally
      {
        enumerator.close();
      }
    }
  }
  
  /**
   * @deprecated
   */
  public Comparable[] getCustom(IndexReader reader, String field, SortComparator comparator)
    throws IOException
  {
    return (Comparable[])((Cache)caches.get(Comparable.class)).get(reader, new Entry(field, comparator));
  }
  
  /**
   * @deprecated
   */
  static final class CustomCache
    extends FieldCacheImpl.Cache
  {
    CustomCache(FieldCache wrapper)
    {
      super();
    }
    
    protected Object createValue(IndexReader reader, FieldCacheImpl.Entry entryKey)
      throws IOException
    {
      FieldCacheImpl.Entry entry = entryKey;
      String field = field;
      SortComparator comparator = (SortComparator)custom;
      Comparable[] retArray = new Comparable[reader.maxDoc()];
      TermDocs termDocs = reader.termDocs();
      TermEnum termEnum = reader.terms(new Term(field));
      try
      {
        do
        {
          Term term = termEnum.term();
          if ((term == null) || (term.field() != field)) {
            break;
          }
          Comparable termval = comparator.getComparable(term.text());
          termDocs.seek(termEnum);
          while (termDocs.next()) {
            retArray[termDocs.doc()] = termval;
          }
        } while (termEnum.next());
      }
      finally
      {
        termDocs.close();
        termEnum.close();
      }
      return retArray;
    }
  }
  
  public void setInfoStream(PrintStream stream)
  {
    infoStream = stream;
  }
  
  public PrintStream getInfoStream()
  {
    return infoStream;
  }
}

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

import org.apache.lucene.index.IndexReader;

class FieldCacheRangeFilter$1$1
  extends FieldCacheRangeFilter.FieldCacheDocIdSet
{
  private final FieldCacheRangeFilter.1 this$0;
  
  FieldCacheRangeFilter$1$1(FieldCacheRangeFilter.1 param1, IndexReader x0, boolean x1, FieldCache.StringIndex paramStringIndex, int paramInt1, int paramInt2)
  {
    super(x0, x1);
  }
  
  final boolean matchDoc(int doc)
  {
    return (val$fcsi.order[doc] >= val$inclusiveLowerPoint) && (val$fcsi.order[doc] <= val$inclusiveUpperPoint);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheRangeFilter.1.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.index.IndexReader;

final class FieldCacheRangeFilter$1
  extends FieldCacheRangeFilter
{
  FieldCacheRangeFilter$1(String x0, FieldCache.Parser x1, Object x2, Object x3, boolean x4, boolean x5)
  {
    super(x0, x1, x2, x3, x4, x5, null);
  }
  
  public DocIdSet getDocIdSet(IndexReader reader)
    throws IOException
  {
    final FieldCache.StringIndex fcsi = FieldCache.DEFAULT.getStringIndex(reader, field);
    int lowerPoint = fcsi.binarySearchLookup((String)lowerVal);
    int upperPoint = fcsi.binarySearchLookup((String)upperVal);
    int inclusiveLowerPoint;
    final int inclusiveLowerPoint;
    if (lowerPoint == 0)
    {
      assert (lowerVal == null);
      inclusiveLowerPoint = 1;
    }
    else
    {
      int inclusiveLowerPoint;
      if ((includeLower) && (lowerPoint > 0))
      {
        inclusiveLowerPoint = lowerPoint;
      }
      else
      {
        int inclusiveLowerPoint;
        if (lowerPoint > 0) {
          inclusiveLowerPoint = lowerPoint + 1;
        } else {
          inclusiveLowerPoint = Math.max(1, -lowerPoint - 1);
        }
      }
    }
    int inclusiveUpperPoint;
    final int inclusiveUpperPoint;
    if (upperPoint == 0)
    {
      assert (upperVal == null);
      inclusiveUpperPoint = Integer.MAX_VALUE;
    }
    else
    {
      int inclusiveUpperPoint;
      if ((includeUpper) && (upperPoint > 0))
      {
        inclusiveUpperPoint = upperPoint;
      }
      else
      {
        int inclusiveUpperPoint;
        if (upperPoint > 0) {
          inclusiveUpperPoint = upperPoint - 1;
        } else {
          inclusiveUpperPoint = -upperPoint - 2;
        }
      }
    }
    if ((inclusiveUpperPoint <= 0) || (inclusiveLowerPoint > inclusiveUpperPoint)) {
      return DocIdSet.EMPTY_DOCIDSET;
    }
    assert ((inclusiveLowerPoint > 0) && (inclusiveUpperPoint > 0));
    
    new FieldCacheRangeFilter.FieldCacheDocIdSet(reader, false)
    {
      final boolean matchDoc(int doc)
      {
        return (fcsiorder[doc] >= inclusiveLowerPoint) && (fcsiorder[doc] <= inclusiveUpperPoint);
      }
    };
  }
}

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

import org.apache.lucene.index.IndexReader;

class FieldCacheRangeFilter$2$1
  extends FieldCacheRangeFilter.FieldCacheDocIdSet
{
  private final FieldCacheRangeFilter.2 this$0;
  
  FieldCacheRangeFilter$2$1(FieldCacheRangeFilter.2 param2, IndexReader x0, boolean x1, byte[] paramArrayOfByte, byte paramByte1, byte paramByte2)
  {
    super(x0, x1);
  }
  
  boolean matchDoc(int doc)
  {
    return (val$values[doc] >= val$inclusiveLowerPoint) && (val$values[doc] <= val$inclusiveUpperPoint);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheRangeFilter.2.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.index.IndexReader;

final class FieldCacheRangeFilter$2
  extends FieldCacheRangeFilter
{
  FieldCacheRangeFilter$2(String x0, FieldCache.Parser x1, Object x2, Object x3, boolean x4, boolean x5)
  {
    super(x0, x1, x2, x3, x4, x5, null);
  }
  
  public DocIdSet getDocIdSet(IndexReader reader)
    throws IOException
  {
    byte inclusiveLowerPoint;
    final byte inclusiveLowerPoint;
    if (lowerVal != null)
    {
      byte i = ((Number)lowerVal).byteValue();
      if ((!includeLower) && (i == Byte.MAX_VALUE)) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      inclusiveLowerPoint = (byte)(includeLower ? i : i + 1);
    }
    else
    {
      inclusiveLowerPoint = Byte.MIN_VALUE;
    }
    byte inclusiveUpperPoint;
    final byte inclusiveUpperPoint;
    if (upperVal != null)
    {
      byte i = ((Number)upperVal).byteValue();
      if ((!includeUpper) && (i == Byte.MIN_VALUE)) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      inclusiveUpperPoint = (byte)(includeUpper ? i : i - 1);
    }
    else
    {
      inclusiveUpperPoint = Byte.MAX_VALUE;
    }
    if (inclusiveLowerPoint > inclusiveUpperPoint) {
      return DocIdSet.EMPTY_DOCIDSET;
    }
    final byte[] values = FieldCache.DEFAULT.getBytes(reader, field, (FieldCache.ByteParser)parser);
    
    new FieldCacheRangeFilter.FieldCacheDocIdSet(reader, (inclusiveLowerPoint <= 0) && (inclusiveUpperPoint >= 0))
    {
      boolean matchDoc(int doc)
      {
        return (values[doc] >= inclusiveLowerPoint) && (values[doc] <= inclusiveUpperPoint);
      }
    };
  }
}

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

import org.apache.lucene.index.IndexReader;

class FieldCacheRangeFilter$3$1
  extends FieldCacheRangeFilter.FieldCacheDocIdSet
{
  private final FieldCacheRangeFilter.3 this$0;
  
  FieldCacheRangeFilter$3$1(FieldCacheRangeFilter.3 param3, IndexReader x0, boolean x1, short[] paramArrayOfShort, short paramShort1, short paramShort2)
  {
    super(x0, x1);
  }
  
  boolean matchDoc(int doc)
  {
    return (val$values[doc] >= val$inclusiveLowerPoint) && (val$values[doc] <= val$inclusiveUpperPoint);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheRangeFilter.3.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.index.IndexReader;

final class FieldCacheRangeFilter$3
  extends FieldCacheRangeFilter
{
  FieldCacheRangeFilter$3(String x0, FieldCache.Parser x1, Object x2, Object x3, boolean x4, boolean x5)
  {
    super(x0, x1, x2, x3, x4, x5, null);
  }
  
  public DocIdSet getDocIdSet(IndexReader reader)
    throws IOException
  {
    short inclusiveLowerPoint;
    final short inclusiveLowerPoint;
    if (lowerVal != null)
    {
      short i = ((Number)lowerVal).shortValue();
      if ((!includeLower) && (i == Short.MAX_VALUE)) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      inclusiveLowerPoint = (short)(includeLower ? i : i + 1);
    }
    else
    {
      inclusiveLowerPoint = Short.MIN_VALUE;
    }
    short inclusiveUpperPoint;
    final short inclusiveUpperPoint;
    if (upperVal != null)
    {
      short i = ((Number)upperVal).shortValue();
      if ((!includeUpper) && (i == Short.MIN_VALUE)) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      inclusiveUpperPoint = (short)(includeUpper ? i : i - 1);
    }
    else
    {
      inclusiveUpperPoint = Short.MAX_VALUE;
    }
    if (inclusiveLowerPoint > inclusiveUpperPoint) {
      return DocIdSet.EMPTY_DOCIDSET;
    }
    final short[] values = FieldCache.DEFAULT.getShorts(reader, field, (FieldCache.ShortParser)parser);
    
    new FieldCacheRangeFilter.FieldCacheDocIdSet(reader, (inclusiveLowerPoint <= 0) && (inclusiveUpperPoint >= 0))
    {
      boolean matchDoc(int doc)
      {
        return (values[doc] >= inclusiveLowerPoint) && (values[doc] <= inclusiveUpperPoint);
      }
    };
  }
}

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

import org.apache.lucene.index.IndexReader;

class FieldCacheRangeFilter$4$1
  extends FieldCacheRangeFilter.FieldCacheDocIdSet
{
  private final FieldCacheRangeFilter.4 this$0;
  
  FieldCacheRangeFilter$4$1(FieldCacheRangeFilter.4 param4, IndexReader x0, boolean x1, int[] paramArrayOfInt, int paramInt1, int paramInt2)
  {
    super(x0, x1);
  }
  
  boolean matchDoc(int doc)
  {
    return (val$values[doc] >= val$inclusiveLowerPoint) && (val$values[doc] <= val$inclusiveUpperPoint);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheRangeFilter.4.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.index.IndexReader;

final class FieldCacheRangeFilter$4
  extends FieldCacheRangeFilter
{
  FieldCacheRangeFilter$4(String x0, FieldCache.Parser x1, Object x2, Object x3, boolean x4, boolean x5)
  {
    super(x0, x1, x2, x3, x4, x5, null);
  }
  
  public DocIdSet getDocIdSet(IndexReader reader)
    throws IOException
  {
    int inclusiveLowerPoint;
    final int inclusiveLowerPoint;
    if (lowerVal != null)
    {
      int i = ((Number)lowerVal).intValue();
      if ((!includeLower) && (i == Integer.MAX_VALUE)) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      inclusiveLowerPoint = includeLower ? i : i + 1;
    }
    else
    {
      inclusiveLowerPoint = Integer.MIN_VALUE;
    }
    int inclusiveUpperPoint;
    final int inclusiveUpperPoint;
    if (upperVal != null)
    {
      int i = ((Number)upperVal).intValue();
      if ((!includeUpper) && (i == Integer.MIN_VALUE)) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      inclusiveUpperPoint = includeUpper ? i : i - 1;
    }
    else
    {
      inclusiveUpperPoint = Integer.MAX_VALUE;
    }
    if (inclusiveLowerPoint > inclusiveUpperPoint) {
      return DocIdSet.EMPTY_DOCIDSET;
    }
    final int[] values = FieldCache.DEFAULT.getInts(reader, field, (FieldCache.IntParser)parser);
    
    new FieldCacheRangeFilter.FieldCacheDocIdSet(reader, (inclusiveLowerPoint <= 0) && (inclusiveUpperPoint >= 0))
    {
      boolean matchDoc(int doc)
      {
        return (values[doc] >= inclusiveLowerPoint) && (values[doc] <= inclusiveUpperPoint);
      }
    };
  }
}

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

import org.apache.lucene.index.IndexReader;

class FieldCacheRangeFilter$5$1
  extends FieldCacheRangeFilter.FieldCacheDocIdSet
{
  private final FieldCacheRangeFilter.5 this$0;
  
  FieldCacheRangeFilter$5$1(FieldCacheRangeFilter.5 param5, IndexReader x0, boolean x1, long[] paramArrayOfLong, long paramLong1, long paramLong2)
  {
    super(x0, x1);
  }
  
  boolean matchDoc(int doc)
  {
    return (val$values[doc] >= val$inclusiveLowerPoint) && (val$values[doc] <= val$inclusiveUpperPoint);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheRangeFilter.5.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.index.IndexReader;

final class FieldCacheRangeFilter$5
  extends FieldCacheRangeFilter
{
  FieldCacheRangeFilter$5(String x0, FieldCache.Parser x1, Object x2, Object x3, boolean x4, boolean x5)
  {
    super(x0, x1, x2, x3, x4, x5, null);
  }
  
  public DocIdSet getDocIdSet(IndexReader reader)
    throws IOException
  {
    long inclusiveLowerPoint;
    final long inclusiveLowerPoint;
    if (lowerVal != null)
    {
      long i = ((Number)lowerVal).longValue();
      if ((!includeLower) && (i == Long.MAX_VALUE)) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      inclusiveLowerPoint = includeLower ? i : i + 1L;
    }
    else
    {
      inclusiveLowerPoint = Long.MIN_VALUE;
    }
    long inclusiveUpperPoint;
    long inclusiveUpperPoint;
    if (upperVal != null)
    {
      long i = ((Number)upperVal).longValue();
      if ((!includeUpper) && (i == Long.MIN_VALUE)) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      inclusiveUpperPoint = includeUpper ? i : i - 1L;
    }
    else
    {
      inclusiveUpperPoint = Long.MAX_VALUE;
    }
    if (inclusiveLowerPoint > inclusiveUpperPoint) {
      return DocIdSet.EMPTY_DOCIDSET;
    }
    final long[] values = FieldCache.DEFAULT.getLongs(reader, field, (FieldCache.LongParser)parser);
    
    new FieldCacheRangeFilter.FieldCacheDocIdSet(reader, (inclusiveLowerPoint <= 0L) && (inclusiveUpperPoint >= 0L))
    {
      boolean matchDoc(int doc)
      {
        return (values[doc] >= inclusiveLowerPoint) && (values[doc] <= val$inclusiveUpperPoint);
      }
    };
  }
}

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

import org.apache.lucene.index.IndexReader;

class FieldCacheRangeFilter$6$1
  extends FieldCacheRangeFilter.FieldCacheDocIdSet
{
  private final FieldCacheRangeFilter.6 this$0;
  
  FieldCacheRangeFilter$6$1(FieldCacheRangeFilter.6 param6, IndexReader x0, boolean x1, float[] paramArrayOfFloat, float paramFloat1, float paramFloat2)
  {
    super(x0, x1);
  }
  
  boolean matchDoc(int doc)
  {
    return (val$values[doc] >= val$inclusiveLowerPoint) && (val$values[doc] <= val$inclusiveUpperPoint);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheRangeFilter.6.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.index.IndexReader;
import org.apache.lucene.util.NumericUtils;

final class FieldCacheRangeFilter$6
  extends FieldCacheRangeFilter
{
  FieldCacheRangeFilter$6(String x0, FieldCache.Parser x1, Object x2, Object x3, boolean x4, boolean x5)
  {
    super(x0, x1, x2, x3, x4, x5, null);
  }
  
  public DocIdSet getDocIdSet(IndexReader reader)
    throws IOException
  {
    float inclusiveLowerPoint;
    final float inclusiveLowerPoint;
    if (lowerVal != null)
    {
      float f = ((Number)lowerVal).floatValue();
      if ((!includeUpper) && (f > 0.0F) && (Float.isInfinite(f))) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      int i = NumericUtils.floatToSortableInt(f);
      inclusiveLowerPoint = NumericUtils.sortableIntToFloat(includeLower ? i : i + 1);
    }
    else
    {
      inclusiveLowerPoint = Float.NEGATIVE_INFINITY;
    }
    float inclusiveUpperPoint;
    final float inclusiveUpperPoint;
    if (upperVal != null)
    {
      float f = ((Number)upperVal).floatValue();
      if ((!includeUpper) && (f < 0.0F) && (Float.isInfinite(f))) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      int i = NumericUtils.floatToSortableInt(f);
      inclusiveUpperPoint = NumericUtils.sortableIntToFloat(includeUpper ? i : i - 1);
    }
    else
    {
      inclusiveUpperPoint = Float.POSITIVE_INFINITY;
    }
    if (inclusiveLowerPoint > inclusiveUpperPoint) {
      return DocIdSet.EMPTY_DOCIDSET;
    }
    final float[] values = FieldCache.DEFAULT.getFloats(reader, field, (FieldCache.FloatParser)parser);
    
    new FieldCacheRangeFilter.FieldCacheDocIdSet(reader, (inclusiveLowerPoint <= 0.0F) && (inclusiveUpperPoint >= 0.0F))
    {
      boolean matchDoc(int doc)
      {
        return (values[doc] >= inclusiveLowerPoint) && (values[doc] <= inclusiveUpperPoint);
      }
    };
  }
}

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

import org.apache.lucene.index.IndexReader;

class FieldCacheRangeFilter$7$1
  extends FieldCacheRangeFilter.FieldCacheDocIdSet
{
  private final FieldCacheRangeFilter.7 this$0;
  
  FieldCacheRangeFilter$7$1(FieldCacheRangeFilter.7 param7, IndexReader x0, boolean x1, double[] paramArrayOfDouble, double paramDouble1, double paramDouble2)
  {
    super(x0, x1);
  }
  
  boolean matchDoc(int doc)
  {
    return (val$values[doc] >= val$inclusiveLowerPoint) && (val$values[doc] <= val$inclusiveUpperPoint);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheRangeFilter.7.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.index.IndexReader;
import org.apache.lucene.util.NumericUtils;

final class FieldCacheRangeFilter$7
  extends FieldCacheRangeFilter
{
  FieldCacheRangeFilter$7(String x0, FieldCache.Parser x1, Object x2, Object x3, boolean x4, boolean x5)
  {
    super(x0, x1, x2, x3, x4, x5, null);
  }
  
  public DocIdSet getDocIdSet(IndexReader reader)
    throws IOException
  {
    double inclusiveLowerPoint;
    final double inclusiveLowerPoint;
    if (lowerVal != null)
    {
      double f = ((Number)lowerVal).doubleValue();
      if ((!includeUpper) && (f > 0.0D) && (Double.isInfinite(f))) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      long i = NumericUtils.doubleToSortableLong(f);
      inclusiveLowerPoint = NumericUtils.sortableLongToDouble(includeLower ? i : i + 1L);
    }
    else
    {
      inclusiveLowerPoint = Double.NEGATIVE_INFINITY;
    }
    double inclusiveUpperPoint;
    double inclusiveUpperPoint;
    if (upperVal != null)
    {
      double f = ((Number)upperVal).doubleValue();
      if ((!includeUpper) && (f < 0.0D) && (Double.isInfinite(f))) {
        return DocIdSet.EMPTY_DOCIDSET;
      }
      long i = NumericUtils.doubleToSortableLong(f);
      inclusiveUpperPoint = NumericUtils.sortableLongToDouble(includeUpper ? i : i - 1L);
    }
    else
    {
      inclusiveUpperPoint = Double.POSITIVE_INFINITY;
    }
    if (inclusiveLowerPoint > inclusiveUpperPoint) {
      return DocIdSet.EMPTY_DOCIDSET;
    }
    final double[] values = FieldCache.DEFAULT.getDoubles(reader, field, (FieldCache.DoubleParser)parser);
    
    new FieldCacheRangeFilter.FieldCacheDocIdSet(reader, (inclusiveLowerPoint <= 0.0D) && (inclusiveUpperPoint >= 0.0D))
    {
      boolean matchDoc(int doc)
      {
        return (values[doc] >= inclusiveLowerPoint) && (values[doc] <= val$inclusiveUpperPoint);
      }
    };
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheRangeFilter.7
 * 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.TermDocs;

class FieldCacheRangeFilter$FieldCacheDocIdSet$1
  extends DocIdSetIterator
{
  private int doc = -1;
  private final FieldCacheRangeFilter.FieldCacheDocIdSet this$0;
  
  FieldCacheRangeFilter$FieldCacheDocIdSet$1(FieldCacheRangeFilter.FieldCacheDocIdSet paramFieldCacheDocIdSet, TermDocs paramTermDocs) {}
  
  /**
   * @deprecated
   */
  public boolean next()
    throws IOException
  {
    return nextDoc() != Integer.MAX_VALUE;
  }
  
  /**
   * @deprecated
   */
  public boolean skipTo(int target)
    throws IOException
  {
    return advance(target) != Integer.MAX_VALUE;
  }
  
  /**
   * @deprecated
   */
  public int doc()
  {
    return val$termDocs.doc();
  }
  
  public int docID()
  {
    return doc;
  }
  
  public int nextDoc()
    throws IOException
  {
    do
    {
      if (!val$termDocs.next()) {
        return doc = Integer.MAX_VALUE;
      }
    } while (!this$0.matchDoc(doc = val$termDocs.doc()));
    return doc;
  }
  
  public int advance(int target)
    throws IOException
  {
    if (!val$termDocs.skipTo(target)) {
      return doc = Integer.MAX_VALUE;
    }
    while (!this$0.matchDoc(doc = val$termDocs.doc())) {
      if (!val$termDocs.next()) {
        return doc = Integer.MAX_VALUE;
      }
    }
    return doc;
  }
}

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

import java.io.IOException;

class FieldCacheRangeFilter$FieldCacheDocIdSet$2
  extends DocIdSetIterator
{
  private int doc = -1;
  private final FieldCacheRangeFilter.FieldCacheDocIdSet this$0;
  
  FieldCacheRangeFilter$FieldCacheDocIdSet$2(FieldCacheRangeFilter.FieldCacheDocIdSet paramFieldCacheDocIdSet) {}
  
  /**
   * @deprecated
   */
  public boolean next()
    throws IOException
  {
    return nextDoc() != Integer.MAX_VALUE;
  }
  
  /**
   * @deprecated
   */
  public boolean skipTo(int target)
    throws IOException
  {
    return advance(target) != Integer.MAX_VALUE;
  }
  
  /**
   * @deprecated
   */
  public int doc()
  {
    return doc;
  }
  
  public int docID()
  {
    return doc;
  }
  
  public int nextDoc()
  {
    try
    {
      do
      {
        doc += 1;
      } while (!this$0.matchDoc(doc));
      return doc;
    }
    catch (ArrayIndexOutOfBoundsException e) {}
    return doc = Integer.MAX_VALUE;
  }
  
  public int advance(int target)
  {
    try
    {
      doc = target;
      while (!this$0.matchDoc(doc)) {
        doc += 1;
      }
      return doc;
    }
    catch (ArrayIndexOutOfBoundsException e) {}
    return doc = Integer.MAX_VALUE;
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheRangeFilter.FieldCacheDocIdSet.2
 * 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.TermDocs;

abstract class FieldCacheRangeFilter$FieldCacheDocIdSet
  extends DocIdSet
{
  private final IndexReader reader;
  private boolean mayUseTermDocs;
  
  FieldCacheRangeFilter$FieldCacheDocIdSet(IndexReader reader, boolean mayUseTermDocs)
  {
    this.reader = reader;
    this.mayUseTermDocs = mayUseTermDocs;
  }
  
  abstract boolean matchDoc(int paramInt)
    throws ArrayIndexOutOfBoundsException;
  
  public boolean isCacheable()
  {
    return (!mayUseTermDocs) || (!reader.hasDeletions());
  }
  
  public DocIdSetIterator iterator()
    throws IOException
  {
    final TermDocs termDocs;
    synchronized (reader)
    {
      termDocs = isCacheable() ? null : reader.termDocs(null);
    }
    if (termDocs != null) {
      new DocIdSetIterator()
      {
        private int doc = -1;
        
        /**
         * @deprecated
         */
        public boolean next()
          throws IOException
        {
          return nextDoc() != Integer.MAX_VALUE;
        }
        
        /**
         * @deprecated
         */
        public boolean skipTo(int target)
          throws IOException
        {
          return advance(target) != Integer.MAX_VALUE;
        }
        
        /**
         * @deprecated
         */
        public int doc()
        {
          return termDocs.doc();
        }
        
        public int docID()
        {
          return doc;
        }
        
        public int nextDoc()
          throws IOException
        {
          do
          {
            if (!termDocs.next()) {
              return doc = Integer.MAX_VALUE;
            }
          } while (!matchDoc(doc = termDocs.doc()));
          return doc;
        }
        
        public int advance(int target)
          throws IOException
        {
          if (!termDocs.skipTo(target)) {
            return doc = Integer.MAX_VALUE;
          }
          while (!matchDoc(doc = termDocs.doc())) {
            if (!termDocs.next()) {
              return doc = Integer.MAX_VALUE;
            }
          }
          return doc;
        }
      };
    }
    new DocIdSetIterator()
    {
      private int doc = -1;
      
      /**
       * @deprecated
       */
      public boolean next()
        throws IOException
      {
        return nextDoc() != Integer.MAX_VALUE;
      }
      
      /**
       * @deprecated
       */
      public boolean skipTo(int target)
        throws IOException
      {
        return advance(target) != Integer.MAX_VALUE;
      }
      
      /**
       * @deprecated
       */
      public int doc()
      {
        return doc;
      }
      
      public int docID()
      {
        return doc;
      }
      
      public int nextDoc()
      {
        try
        {
          do
          {
            doc += 1;
          } while (!matchDoc(doc));
          return doc;
        }
        catch (ArrayIndexOutOfBoundsException e) {}
        return doc = Integer.MAX_VALUE;
      }
      
      public int advance(int target)
      {
        try
        {
          doc = target;
          while (!matchDoc(doc)) {
            doc += 1;
          }
          return doc;
        }
        catch (ArrayIndexOutOfBoundsException e) {}
        return doc = Integer.MAX_VALUE;
      }
    };
  }
}

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

import org.apache.lucene.util.OpenBitSet;

public class FieldCacheTermsFilter$FieldCacheTermsFilterDocIdSet$FieldCacheTermsFilterDocIdSetIterator
  extends DocIdSetIterator
{
  private int doc = -1;
  private final FieldCacheTermsFilter.FieldCacheTermsFilterDocIdSet this$1;
  
  protected FieldCacheTermsFilter$FieldCacheTermsFilterDocIdSet$FieldCacheTermsFilterDocIdSetIterator(FieldCacheTermsFilter.FieldCacheTermsFilterDocIdSet paramFieldCacheTermsFilterDocIdSet) {}
  
  /**
   * @deprecated
   */
  public int doc()
  {
    return doc;
  }
  
  public int docID()
  {
    return doc;
  }
  
  /**
   * @deprecated
   */
  public boolean next()
  {
    return nextDoc() != Integer.MAX_VALUE;
  }
  
  public int nextDoc()
  {
    try
    {
      while (!FieldCacheTermsFilter.FieldCacheTermsFilterDocIdSet.access$200(this$1).fastGet(access$100this$1).order[(++doc)])) {}
    }
    catch (ArrayIndexOutOfBoundsException e)
    {
      doc = Integer.MAX_VALUE;
    }
    return doc;
  }
  
  /**
   * @deprecated
   */
  public boolean skipTo(int target)
  {
    return advance(target) != Integer.MAX_VALUE;
  }
  
  public int advance(int target)
  {
    try
    {
      doc = target;
      while (!FieldCacheTermsFilter.FieldCacheTermsFilterDocIdSet.access$200(this$1).fastGet(access$100this$1).order[doc])) {
        doc += 1;
      }
    }
    catch (ArrayIndexOutOfBoundsException e)
    {
      doc = Integer.MAX_VALUE;
    }
    return doc;
  }
}

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

import org.apache.lucene.util.OpenBitSet;

public class FieldCacheTermsFilter$FieldCacheTermsFilterDocIdSet
  extends DocIdSet
{
  private FieldCache.StringIndex fcsi;
  private OpenBitSet openBitSet;
  private final FieldCacheTermsFilter this$0;
  
  public FieldCacheTermsFilter$FieldCacheTermsFilterDocIdSet(FieldCacheTermsFilter arg1, FieldCache.StringIndex fcsi)
  {
    this.fcsi = fcsi;
    openBitSet = new OpenBitSet(fcsilookup.length);
    for (int i = 0; i < FieldCacheTermsFilter.access$000(???).length; i++)
    {
      int termNumber = this.fcsi.binarySearchLookup(FieldCacheTermsFilter.access$000(???)[i]);
      if (termNumber > 0) {
        openBitSet.fastSet(termNumber);
      }
    }
  }
  
  public DocIdSetIterator iterator()
  {
    return new FieldCacheTermsFilterDocIdSetIterator();
  }
  
  public boolean isCacheable()
  {
    return true;
  }
  
  protected class FieldCacheTermsFilterDocIdSetIterator
    extends DocIdSetIterator
  {
    private int doc = -1;
    
    protected FieldCacheTermsFilterDocIdSetIterator() {}
    
    /**
     * @deprecated
     */
    public int doc()
    {
      return doc;
    }
    
    public int docID()
    {
      return doc;
    }
    
    /**
     * @deprecated
     */
    public boolean next()
    {
      return nextDoc() != Integer.MAX_VALUE;
    }
    
    public int nextDoc()
    {
      try
      {
        while (!openBitSet.fastGet(fcsi.order[(++doc)])) {}
      }
      catch (ArrayIndexOutOfBoundsException e)
      {
        doc = Integer.MAX_VALUE;
      }
      return doc;
    }
    
    /**
     * @deprecated
     */
    public boolean skipTo(int target)
    {
      return advance(target) != Integer.MAX_VALUE;
    }
    
    public int advance(int target)
    {
      try
      {
        doc = target;
        while (!openBitSet.fastGet(fcsi.order[doc])) {
          doc += 1;
        }
      }
      catch (ArrayIndexOutOfBoundsException e)
      {
        doc = Integer.MAX_VALUE;
      }
      return doc;
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheTermsFilter.FieldCacheTermsFilterDocIdSet
 * 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.OpenBitSet;

public class FieldCacheTermsFilter
  extends Filter
{
  private String field;
  private String[] terms;
  
  public FieldCacheTermsFilter(String field, String[] terms)
  {
    this.field = field;
    this.terms = terms;
  }
  
  public FieldCache getFieldCache()
  {
    return FieldCache.DEFAULT;
  }
  
  public DocIdSet getDocIdSet(IndexReader reader)
    throws IOException
  {
    return new FieldCacheTermsFilterDocIdSet(getFieldCache().getStringIndex(reader, field));
  }
  
  protected class FieldCacheTermsFilterDocIdSet
    extends DocIdSet
  {
    private FieldCache.StringIndex fcsi;
    private OpenBitSet openBitSet;
    
    public FieldCacheTermsFilterDocIdSet(FieldCache.StringIndex fcsi)
    {
      this.fcsi = fcsi;
      openBitSet = new OpenBitSet(fcsilookup.length);
      for (int i = 0; i < terms.length; i++)
      {
        int termNumber = this.fcsi.binarySearchLookup(terms[i]);
        if (termNumber > 0) {
          openBitSet.fastSet(termNumber);
        }
      }
    }
    
    public DocIdSetIterator iterator()
    {
      return new FieldCacheTermsFilterDocIdSetIterator();
    }
    
    public boolean isCacheable()
    {
      return true;
    }
    
    protected class FieldCacheTermsFilterDocIdSetIterator
      extends DocIdSetIterator
    {
      private int doc = -1;
      
      protected FieldCacheTermsFilterDocIdSetIterator() {}
      
      /**
       * @deprecated
       */
      public int doc()
      {
        return doc;
      }
      
      public int docID()
      {
        return doc;
      }
      
      /**
       * @deprecated
       */
      public boolean next()
      {
        return nextDoc() != Integer.MAX_VALUE;
      }
      
      public int nextDoc()
      {
        try
        {
          while (!openBitSet.fastGet(fcsi.order[(++doc)])) {}
        }
        catch (ArrayIndexOutOfBoundsException e)
        {
          doc = Integer.MAX_VALUE;
        }
        return doc;
      }
      
      /**
       * @deprecated
       */
      public boolean skipTo(int target)
      {
        return advance(target) != Integer.MAX_VALUE;
      }
      
      public int advance(int target)
      {
        try
        {
          doc = target;
          while (!openBitSet.fastGet(fcsi.order[doc])) {
            doc += 1;
          }
        }
        catch (ArrayIndexOutOfBoundsException e)
        {
          doc = Integer.MAX_VALUE;
        }
        return doc;
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldCacheTermsFilter
 * 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;

public final class FieldComparator$ByteComparator
  extends FieldComparator
{
  private final byte[] values;
  private byte[] currentReaderValues;
  private final String field;
  private FieldCache.ByteParser parser;
  private byte bottom;
  
  FieldComparator$ByteComparator(int numHits, String field, FieldCache.Parser parser)
  {
    values = new byte[numHits];
    this.field = field;
    this.parser = ((FieldCache.ByteParser)parser);
  }
  
  public int compare(int slot1, int slot2)
  {
    return values[slot1] - values[slot2];
  }
  
  public int compareBottom(int doc)
  {
    return bottom - currentReaderValues[doc];
  }
  
  public void copy(int slot, int doc)
  {
    values[slot] = currentReaderValues[doc];
  }
  
  public void setNextReader(IndexReader reader, int docBase)
    throws IOException
  {
    currentReaderValues = FieldCache.DEFAULT.getBytes(reader, field, parser);
  }
  
  public void setBottom(int bottom)
  {
    this.bottom = values[bottom];
  }
  
  public Comparable value(int slot)
  {
    return new Byte(values[slot]);
  }
}

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

import org.apache.lucene.index.IndexReader;

public final class FieldComparator$DocComparator
  extends FieldComparator
{
  private final int[] docIDs;
  private int docBase;
  private int bottom;
  
  FieldComparator$DocComparator(int numHits)
  {
    docIDs = new int[numHits];
  }
  
  public int compare(int slot1, int slot2)
  {
    return docIDs[slot1] - docIDs[slot2];
  }
  
  public int compareBottom(int doc)
  {
    return bottom - (docBase + doc);
  }
  
  public void copy(int slot, int doc)
  {
    docIDs[slot] = (docBase + doc);
  }
  
  public void setNextReader(IndexReader reader, int docBase)
  {
    this.docBase = docBase;
  }
  
  public void setBottom(int bottom)
  {
    this.bottom = docIDs[bottom];
  }
  
  public Comparable value(int slot)
  {
    return new Integer(docIDs[slot]);
  }
}

/* Location:
 * Qualified Name:     org.apache.lucene.search.FieldComparator.DocComparator
 * 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;

public final class FieldComparator$DoubleComparator
  extends FieldComparator
{
  private final double[] values;
  private double[] currentReaderValues;
  private final String field;
  private FieldCache.DoubleParser parser;
  private double bottom;
  
  FieldComparator$DoubleComparator(int numHits, String field, FieldCache.Parser parser)
  {
    values = new double[numHits];
    this.field = field;
    this.parser = ((FieldCache.DoubleParser)parser);
  }
  
  public int compare(int slot1, int slot2)
  {
    double v1 = values[slot1];
    double v2 = values[slot2];
    if (v1 > v2) {
      return 1;
    }
    if (v1 < v2) {
      return -1;
    }
    return 0;
  }
  
  public int compareBottom(int doc)
  {
    double v2 = currentReaderValues[doc];
    if (bottom > v2) {
      return 1;
    }
    if (bottom < v2) {
      return -1;
    }
    return 0;
  }
  
  public void copy(int slot, int doc)
  {
    values[slot] = currentReaderValues[doc];
  }
  
  public void setNextReader(IndexReader re
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