Ejemplo n.º 1
0
        // prevent instantiation and extension.
        private FieldValueHitQueue(SortField[] fields)
        {
            // When we get here, fields.length is guaranteed to be > 0, therefore no
            // need to check it again.

            // All these are required by this class's API - need to return arrays.
            // Therefore even in the case of a single comparator, create an array
            // anyway.
            this.fields = fields;
            int numComparators = fields.Length;

            comparators = new FieldComparator[numComparators];
            reverseMul  = new int[numComparators];
        }
Ejemplo n.º 2
0
            public OneComparatorFieldValueHitQueue(SortField[] fields, int size) : base(fields)
            {
                if (fields.Length == 0)
                {
                    throw new System.ArgumentException("Sort must contain at least one field");
                }

                SortField field = fields[0];

                comparator    = field.GetComparator(size, 0);
                oneReverseMul = field.reverse?-1:1;

                comparators[0] = comparator;
                reverseMul[0]  = oneReverseMul;

                Initialize(size);
            }
Ejemplo n.º 3
0
 public OneComparatorNonScoringCollector(FieldValueHitQueue queue, int numHits, bool fillFields) : base(queue, numHits, fillFields)
 {
     comparator = queue.GetComparators()[0];
     reverseMul = queue.GetReverseMul()[0];
 }