// 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]; }
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]; // AUTO is resolved before we are called System.Diagnostics.Debug.Assert(field.GetType() != SortField.AUTO); comparator = field.GetComparator(size, 0); oneReverseMul = field.reverse?-1:1; comparators[0] = comparator; reverseMul[0] = oneReverseMul; Initialize(size); }
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]; // AUTO is resolved before we are called System.Diagnostics.Debug.Assert(field.GetType() != SortField.AUTO); comparator = field.GetComparator(size, 0); oneReverseMul = field.reverse?- 1:1; comparators[0] = comparator; reverseMul[0] = oneReverseMul; Initialize(size); }
public OneComparatorNonScoringCollector(FieldValueHitQueue queue, int numHits, bool fillFields):base(queue, numHits, fillFields) { comparator = queue.GetComparators()[0]; reverseMul = queue.GetReverseMul()[0]; }
public OneComparatorNonScoringCollector(FieldValueHitQueue queue, int numHits, bool fillFields) : base(queue, numHits, fillFields) { comparator = queue.GetComparators()[0]; reverseMul = queue.GetReverseMul()[0]; }