//
//  Generated by the J2ObjC translator.  DO NOT EDIT!
//  source: ./core/src/java/org/apache/lucene/search/FieldComparator.java
//

#include "J2ObjC_header.h"

#pragma push_macro("INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator")
#ifdef RESTRICT_OrgApacheLuceneSearchFieldComparator
#define INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator 0
#else
#define INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator 1
#endif
#undef RESTRICT_OrgApacheLuceneSearchFieldComparator
#ifdef INCLUDE_OrgApacheLuceneSearchFieldComparator_TermValComparator
#define INCLUDE_OrgApacheLuceneSearchFieldComparator 1
#endif
#ifdef INCLUDE_OrgApacheLuceneSearchFieldComparator_TermOrdValComparator
#define INCLUDE_OrgApacheLuceneSearchFieldComparator 1
#endif
#ifdef INCLUDE_OrgApacheLuceneSearchFieldComparator_DocComparator
#define INCLUDE_OrgApacheLuceneSearchFieldComparator 1
#endif
#ifdef INCLUDE_OrgApacheLuceneSearchFieldComparator_RelevanceComparator
#define INCLUDE_OrgApacheLuceneSearchFieldComparator 1
#endif
#ifdef INCLUDE_OrgApacheLuceneSearchFieldComparator_LongComparator
#define INCLUDE_OrgApacheLuceneSearchFieldComparator_NumericComparator 1
#endif
#ifdef INCLUDE_OrgApacheLuceneSearchFieldComparator_IntComparator
#define INCLUDE_OrgApacheLuceneSearchFieldComparator_NumericComparator 1
#endif
#ifdef INCLUDE_OrgApacheLuceneSearchFieldComparator_FloatComparator
#define INCLUDE_OrgApacheLuceneSearchFieldComparator_NumericComparator 1
#endif
#ifdef INCLUDE_OrgApacheLuceneSearchFieldComparator_DoubleComparator
#define INCLUDE_OrgApacheLuceneSearchFieldComparator_NumericComparator 1
#endif

#if __has_feature(nullability)
#pragma clang diagnostic push
#pragma GCC diagnostic ignored "-Wnullability"
#pragma GCC diagnostic ignored "-Wnullability-completeness"
#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator))
#define OrgApacheLuceneSearchFieldComparator_

@class OrgApacheLuceneIndexLeafReaderContext;
@protocol OrgApacheLuceneSearchLeafFieldComparator;

/*!
 @brief Expert: a FieldComparator compares hits so as to determine their
  sort order when collecting the top results with <code>TopFieldCollector</code>
 .The concrete public FieldComparator
  classes here correspond to the SortField types.
 <p>This API is designed to achieve high performance
  sorting, by exposing a tight interaction with <code>FieldValueHitQueue</code>
  as it visits hits.  Whenever a hit is
  competitive, it's enrolled into a virtual slot, which is
  an int ranging from 0 to numHits-1. Segment transitions are
  handled by creating a dedicated per-segment 
 <code>LeafFieldComparator</code> which also needs to interact
  with the <code>FieldValueHitQueue</code> but can optimize based
  on the segment to collect.</p>
   
 <p>The following functions need to be implemented</p>
  <ul>
   <li> <code>compare</code> Compare a hit at 'slot a'
        with hit 'slot b'.   
 <li> <code>setTopValue</code> This method is called by
        <code>TopFieldCollector</code> to notify the
        FieldComparator of the top most value, which is
        used by future calls to       
 <code>LeafFieldComparator.compareTop</code>.
  
   <li> <code>getLeafComparator(org.apache.lucene.index.LeafReaderContext)</code> Invoked
        when the search is switching to the next segment.
        You may need to update internal state of the
        comparator, for example retrieving new values from
        DocValues.  
 <li> <code>value</code> Return the sort value stored in
        the specified slot.  This is only called at the end
        of the search, in order to populate <code>FieldDoc.fields</code>
  when returning the top results. 
 </ul>
 - seealso: LeafFieldComparator
 */
@interface OrgApacheLuceneSearchFieldComparator : NSObject

#pragma mark Public

- (instancetype __nonnull)init;

/*!
 @brief Compare hit at slot1 with hit at slot2.
 @param slot1 first slot to compare
 @param slot2 second slot to compare
 @return any <code>N < 0</code> if slot2's value is sorted after
  slot1, any <code>N > 0</code> if the slot2's value is sorted before
  slot1 and <code>0</code> if they are equal
 */
- (jint)compareWithInt:(jint)slot1
               withInt:(jint)slot2;

/*!
 @brief Returns a negative integer if first is less than second,
   0 if they are equal and a positive integer otherwise.Default
   impl to assume the type implements Comparable and
   invoke .compareTo; be sure to override this method if
   your FieldComparator's type isn't a Comparable or
   if your values may sometimes be null
 */
- (jint)compareValuesWithId:(id)first
                     withId:(id)second;

/*!
 @brief Get a per-segment <code>LeafFieldComparator</code> to collect the given 
 <code>org.apache.lucene.index.LeafReaderContext</code>.All docIDs supplied to
  this <code>LeafFieldComparator</code> are relative to the current reader (you
  must add docBase if you need to map it to a top-level docID).
 @param context current reader context
 @return the comparator to use for this segment
 @throw IOExceptionif there is a low-level IO error
 */
- (id<OrgApacheLuceneSearchLeafFieldComparator>)getLeafComparatorWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context;

/*!
 @brief Record the top value, for future calls to <code>LeafFieldComparator.compareTop</code>
 .This is only called for searches that
  use searchAfter (deep paging), and is called before any
  calls to <code>getLeafComparator(LeafReaderContext)</code>.
 */
- (void)setTopValueWithId:(id)value;

/*!
 @brief Return the actual value in the slot.
 @param slot the value
 @return value in this slot
 */
- (id)valueWithInt:(jint)slot;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_init(OrgApacheLuceneSearchFieldComparator *self);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator)

#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_NumericComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator_NumericComparator))
#define OrgApacheLuceneSearchFieldComparator_NumericComparator_

#define RESTRICT_OrgApacheLuceneSearchSimpleFieldComparator 1
#define INCLUDE_OrgApacheLuceneSearchSimpleFieldComparator 1
#include "org/apache/lucene/search/SimpleFieldComparator.h"

@class OrgApacheLuceneIndexLeafReaderContext;
@class OrgApacheLuceneIndexNumericDocValues;
@protocol OrgApacheLuceneUtilBits;

/*!
 @brief Base FieldComparator class for numeric types
 */
@interface OrgApacheLuceneSearchFieldComparator_NumericComparator : OrgApacheLuceneSearchSimpleFieldComparator {
 @public
  NSNumber *missingValue_;
  NSString *field_;
  id<OrgApacheLuceneUtilBits> docsWithField_;
  OrgApacheLuceneIndexNumericDocValues *currentReaderValues_;
}

#pragma mark Public

- (instancetype __nonnull)initWithNSString:(NSString *)field
                              withNSNumber:(NSNumber *)missingValue;

- (NSNumber *)valueWithInt:(jint)arg0;

#pragma mark Protected

- (void)doSetNextReaderWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context;

/*!
 @brief Retrieves a <code>Bits</code> instance representing documents that have a value in this segment.
 */
- (id<OrgApacheLuceneUtilBits>)getDocsWithValueWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context
                                                                            withNSString:(NSString *)field;

/*!
 @brief Retrieves the NumericDocValues for the field in this segment
 */
- (OrgApacheLuceneIndexNumericDocValues *)getNumericDocValuesWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context
                                                                                          withNSString:(NSString *)field;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)init NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator_NumericComparator)

J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_NumericComparator, missingValue_, NSNumber *)
J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_NumericComparator, field_, NSString *)
J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_NumericComparator, docsWithField_, id<OrgApacheLuceneUtilBits>)
J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_NumericComparator, currentReaderValues_, OrgApacheLuceneIndexNumericDocValues *)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_NumericComparator_initWithNSString_withNSNumber_(OrgApacheLuceneSearchFieldComparator_NumericComparator *self, NSString *field, NSNumber *missingValue);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator_NumericComparator)

#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_DoubleComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator_DoubleComparator))
#define OrgApacheLuceneSearchFieldComparator_DoubleComparator_

@class JavaLangDouble;

/*!
 @brief Parses field's values as double (using <code>org.apache.lucene.index.LeafReader.getNumericDocValues</code>
  and sorts by ascending value
 */
@interface OrgApacheLuceneSearchFieldComparator_DoubleComparator : OrgApacheLuceneSearchFieldComparator_NumericComparator

#pragma mark Public

/*!
 @brief Creates a new comparator based on <code>Double.compare</code> for <code>numHits</code>.
 When a document has no value for the field, <code>missingValue</code> is substituted.
 */
- (instancetype __nonnull)initWithInt:(jint)numHits
                         withNSString:(NSString *)field
                   withJavaLangDouble:(JavaLangDouble *)missingValue;

- (jint)compareWithInt:(jint)slot1
               withInt:(jint)slot2;

- (jint)compareBottomWithInt:(jint)doc;

- (jint)compareTopWithInt:(jint)doc;

- (void)copy__WithInt:(jint)slot
              withInt:(jint)doc OBJC_METHOD_FAMILY_NONE;

- (void)setBottomWithInt:(jint)bottom;

- (void)setTopValueWithId:(JavaLangDouble *)value;

- (JavaLangDouble *)valueWithInt:(jint)slot;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)initWithNSString:(NSString *)arg0
                              withNSNumber:(NSNumber *)arg1 NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator_DoubleComparator)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_DoubleComparator_initWithInt_withNSString_withJavaLangDouble_(OrgApacheLuceneSearchFieldComparator_DoubleComparator *self, jint numHits, NSString *field, JavaLangDouble *missingValue);

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_DoubleComparator *new_OrgApacheLuceneSearchFieldComparator_DoubleComparator_initWithInt_withNSString_withJavaLangDouble_(jint numHits, NSString *field, JavaLangDouble *missingValue) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_DoubleComparator *create_OrgApacheLuceneSearchFieldComparator_DoubleComparator_initWithInt_withNSString_withJavaLangDouble_(jint numHits, NSString *field, JavaLangDouble *missingValue);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator_DoubleComparator)

#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_FloatComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator_FloatComparator))
#define OrgApacheLuceneSearchFieldComparator_FloatComparator_

@class JavaLangFloat;

/*!
 @brief Parses field's values as float (using <code>org.apache.lucene.index.LeafReader.getNumericDocValues(String)</code>
  and sorts by ascending value
 */
@interface OrgApacheLuceneSearchFieldComparator_FloatComparator : OrgApacheLuceneSearchFieldComparator_NumericComparator

#pragma mark Public

/*!
 @brief Creates a new comparator based on <code>Float.compare</code> for <code>numHits</code>.
 When a document has no value for the field, <code>missingValue</code> is substituted.
 */
- (instancetype __nonnull)initWithInt:(jint)numHits
                         withNSString:(NSString *)field
                    withJavaLangFloat:(JavaLangFloat *)missingValue;

- (jint)compareWithInt:(jint)slot1
               withInt:(jint)slot2;

- (jint)compareBottomWithInt:(jint)doc;

- (jint)compareTopWithInt:(jint)doc;

- (void)copy__WithInt:(jint)slot
              withInt:(jint)doc OBJC_METHOD_FAMILY_NONE;

- (void)setBottomWithInt:(jint)bottom;

- (void)setTopValueWithId:(JavaLangFloat *)value;

- (JavaLangFloat *)valueWithInt:(jint)slot;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)initWithNSString:(NSString *)arg0
                              withNSNumber:(NSNumber *)arg1 NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator_FloatComparator)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_FloatComparator_initWithInt_withNSString_withJavaLangFloat_(OrgApacheLuceneSearchFieldComparator_FloatComparator *self, jint numHits, NSString *field, JavaLangFloat *missingValue);

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_FloatComparator *new_OrgApacheLuceneSearchFieldComparator_FloatComparator_initWithInt_withNSString_withJavaLangFloat_(jint numHits, NSString *field, JavaLangFloat *missingValue) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_FloatComparator *create_OrgApacheLuceneSearchFieldComparator_FloatComparator_initWithInt_withNSString_withJavaLangFloat_(jint numHits, NSString *field, JavaLangFloat *missingValue);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator_FloatComparator)

#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_IntComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator_IntComparator))
#define OrgApacheLuceneSearchFieldComparator_IntComparator_

@class JavaLangInteger;

/*!
 @brief Parses field's values as int (using <code>org.apache.lucene.index.LeafReader.getNumericDocValues(String)</code>
  and sorts by ascending value
 */
@interface OrgApacheLuceneSearchFieldComparator_IntComparator : OrgApacheLuceneSearchFieldComparator_NumericComparator

#pragma mark Public

/*!
 @brief Creates a new comparator based on <code>Integer.compare</code> for <code>numHits</code>.
 When a document has no value for the field, <code>missingValue</code> is substituted.
 */
- (instancetype __nonnull)initWithInt:(jint)numHits
                         withNSString:(NSString *)field
                  withJavaLangInteger:(JavaLangInteger *)missingValue;

- (jint)compareWithInt:(jint)slot1
               withInt:(jint)slot2;

- (jint)compareBottomWithInt:(jint)doc;

- (jint)compareTopWithInt:(jint)doc;

- (void)copy__WithInt:(jint)slot
              withInt:(jint)doc OBJC_METHOD_FAMILY_NONE;

- (void)setBottomWithInt:(jint)bottom;

- (void)setTopValueWithId:(JavaLangInteger *)value;

- (JavaLangInteger *)valueWithInt:(jint)slot;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)initWithNSString:(NSString *)arg0
                              withNSNumber:(NSNumber *)arg1 NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator_IntComparator)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_IntComparator_initWithInt_withNSString_withJavaLangInteger_(OrgApacheLuceneSearchFieldComparator_IntComparator *self, jint numHits, NSString *field, JavaLangInteger *missingValue);

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_IntComparator *new_OrgApacheLuceneSearchFieldComparator_IntComparator_initWithInt_withNSString_withJavaLangInteger_(jint numHits, NSString *field, JavaLangInteger *missingValue) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_IntComparator *create_OrgApacheLuceneSearchFieldComparator_IntComparator_initWithInt_withNSString_withJavaLangInteger_(jint numHits, NSString *field, JavaLangInteger *missingValue);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator_IntComparator)

#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_LongComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator_LongComparator))
#define OrgApacheLuceneSearchFieldComparator_LongComparator_

@class JavaLangLong;

/*!
 @brief Parses field's values as long (using <code>org.apache.lucene.index.LeafReader.getNumericDocValues(String)</code>
  and sorts by ascending value
 */
@interface OrgApacheLuceneSearchFieldComparator_LongComparator : OrgApacheLuceneSearchFieldComparator_NumericComparator

#pragma mark Public

/*!
 @brief Creates a new comparator based on <code>Long.compare</code> for <code>numHits</code>.
 When a document has no value for the field, <code>missingValue</code> is substituted.
 */
- (instancetype __nonnull)initWithInt:(jint)numHits
                         withNSString:(NSString *)field
                     withJavaLangLong:(JavaLangLong *)missingValue;

- (jint)compareWithInt:(jint)slot1
               withInt:(jint)slot2;

- (jint)compareBottomWithInt:(jint)doc;

- (jint)compareTopWithInt:(jint)doc;

- (void)copy__WithInt:(jint)slot
              withInt:(jint)doc OBJC_METHOD_FAMILY_NONE;

- (void)setBottomWithInt:(jint)bottom;

- (void)setTopValueWithId:(JavaLangLong *)value;

- (JavaLangLong *)valueWithInt:(jint)slot;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)initWithNSString:(NSString *)arg0
                              withNSNumber:(NSNumber *)arg1 NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator_LongComparator)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_LongComparator_initWithInt_withNSString_withJavaLangLong_(OrgApacheLuceneSearchFieldComparator_LongComparator *self, jint numHits, NSString *field, JavaLangLong *missingValue);

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_LongComparator *new_OrgApacheLuceneSearchFieldComparator_LongComparator_initWithInt_withNSString_withJavaLangLong_(jint numHits, NSString *field, JavaLangLong *missingValue) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_LongComparator *create_OrgApacheLuceneSearchFieldComparator_LongComparator_initWithInt_withNSString_withJavaLangLong_(jint numHits, NSString *field, JavaLangLong *missingValue);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator_LongComparator)

#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_RelevanceComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator_RelevanceComparator))
#define OrgApacheLuceneSearchFieldComparator_RelevanceComparator_

#define RESTRICT_OrgApacheLuceneSearchLeafFieldComparator 1
#define INCLUDE_OrgApacheLuceneSearchLeafFieldComparator 1
#include "org/apache/lucene/search/LeafFieldComparator.h"

@class JavaLangFloat;
@class OrgApacheLuceneIndexLeafReaderContext;
@class OrgApacheLuceneSearchScorer;

/*!
 @brief Sorts by descending relevance.NOTE: if you are
   sorting only by descending relevance and then
   secondarily by ascending docID, performance is faster
   using <code>TopScoreDocCollector</code> directly (which <code>IndexSearcher.search</code>
  uses when no <code>Sort</code> is
   specified).
 */
@interface OrgApacheLuceneSearchFieldComparator_RelevanceComparator : OrgApacheLuceneSearchFieldComparator < OrgApacheLuceneSearchLeafFieldComparator >

#pragma mark Public

/*!
 @brief Creates a new comparator based on relevance for <code>numHits</code>.
 */
- (instancetype __nonnull)initWithInt:(jint)numHits;

- (jint)compareWithInt:(jint)slot1
               withInt:(jint)slot2;

- (jint)compareBottomWithInt:(jint)doc;

- (jint)compareTopWithInt:(jint)doc;

- (jint)compareValuesWithId:(JavaLangFloat *)first
                     withId:(JavaLangFloat *)second;

- (void)copy__WithInt:(jint)slot
              withInt:(jint)doc OBJC_METHOD_FAMILY_NONE;

- (id<OrgApacheLuceneSearchLeafFieldComparator>)getLeafComparatorWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context;

- (void)setBottomWithInt:(jint)bottom;

- (void)setScorerWithOrgApacheLuceneSearchScorer:(OrgApacheLuceneSearchScorer *)scorer;

- (void)setTopValueWithId:(JavaLangFloat *)value;

- (JavaLangFloat *)valueWithInt:(jint)slot;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)init NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator_RelevanceComparator)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_RelevanceComparator_initWithInt_(OrgApacheLuceneSearchFieldComparator_RelevanceComparator *self, jint numHits);

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_RelevanceComparator *new_OrgApacheLuceneSearchFieldComparator_RelevanceComparator_initWithInt_(jint numHits) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_RelevanceComparator *create_OrgApacheLuceneSearchFieldComparator_RelevanceComparator_initWithInt_(jint numHits);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator_RelevanceComparator)

#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_DocComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator_DocComparator))
#define OrgApacheLuceneSearchFieldComparator_DocComparator_

#define RESTRICT_OrgApacheLuceneSearchLeafFieldComparator 1
#define INCLUDE_OrgApacheLuceneSearchLeafFieldComparator 1
#include "org/apache/lucene/search/LeafFieldComparator.h"

@class JavaLangInteger;
@class OrgApacheLuceneIndexLeafReaderContext;
@class OrgApacheLuceneSearchScorer;

/*!
 @brief Sorts by ascending docID
 */
@interface OrgApacheLuceneSearchFieldComparator_DocComparator : OrgApacheLuceneSearchFieldComparator < OrgApacheLuceneSearchLeafFieldComparator >

#pragma mark Public

/*!
 @brief Creates a new comparator based on document ids for <code>numHits</code>
 */
- (instancetype __nonnull)initWithInt:(jint)numHits;

- (jint)compareWithInt:(jint)slot1
               withInt:(jint)slot2;

- (jint)compareBottomWithInt:(jint)doc;

- (jint)compareTopWithInt:(jint)doc;

- (void)copy__WithInt:(jint)slot
              withInt:(jint)doc OBJC_METHOD_FAMILY_NONE;

- (id<OrgApacheLuceneSearchLeafFieldComparator>)getLeafComparatorWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context;

- (void)setBottomWithInt:(jint)bottom;

- (void)setScorerWithOrgApacheLuceneSearchScorer:(OrgApacheLuceneSearchScorer *)scorer;

- (void)setTopValueWithId:(JavaLangInteger *)value;

- (JavaLangInteger *)valueWithInt:(jint)slot;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)init NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator_DocComparator)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_DocComparator_initWithInt_(OrgApacheLuceneSearchFieldComparator_DocComparator *self, jint numHits);

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_DocComparator *new_OrgApacheLuceneSearchFieldComparator_DocComparator_initWithInt_(jint numHits) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_DocComparator *create_OrgApacheLuceneSearchFieldComparator_DocComparator_initWithInt_(jint numHits);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator_DocComparator)

#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_TermOrdValComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator_TermOrdValComparator))
#define OrgApacheLuceneSearchFieldComparator_TermOrdValComparator_

#define RESTRICT_OrgApacheLuceneSearchLeafFieldComparator 1
#define INCLUDE_OrgApacheLuceneSearchLeafFieldComparator 1
#include "org/apache/lucene/search/LeafFieldComparator.h"

@class IOSIntArray;
@class IOSObjectArray;
@class OrgApacheLuceneIndexLeafReaderContext;
@class OrgApacheLuceneIndexSortedDocValues;
@class OrgApacheLuceneSearchScorer;
@class OrgApacheLuceneUtilBytesRef;

/*!
 @brief Sorts by field's natural Term sort order, using
   ordinals.This is functionally equivalent to <code>org.apache.lucene.search.FieldComparator.TermValComparator</code>
 , but it first resolves the string
   to their relative ordinal positions (using the index
   returned by <code>org.apache.lucene.index.LeafReader.getSortedDocValues(String)</code>), and
   does most comparisons using the ordinals.
 For medium
   to large results, this comparator will be much faster
   than <code>org.apache.lucene.search.FieldComparator.TermValComparator</code>.  For very small
   result sets it may be slower.
 */
@interface OrgApacheLuceneSearchFieldComparator_TermOrdValComparator : OrgApacheLuceneSearchFieldComparator < OrgApacheLuceneSearchLeafFieldComparator > {
 @public
  IOSIntArray *ords_;
  IOSObjectArray *values_;
  IOSIntArray *readerGen_;
  jint currentReaderGen_;
  OrgApacheLuceneIndexSortedDocValues *termsIndex_;
  jint bottomSlot_;
  jint bottomOrd_;
  jboolean bottomSameReader_;
  OrgApacheLuceneUtilBytesRef *bottomValue_;
  /*!
   @brief Set by setTopValue.
   */
  OrgApacheLuceneUtilBytesRef *topValue_;
  jboolean topSameReader_;
  jint topOrd_;
  /*!
   @brief -1 if missing values are sorted first, 1 if they are
   sorted last
   */
  jint missingSortCmp_;
  /*!
   @brief Which ordinal to use for a missing value.
   */
  jint missingOrd_;
}

#pragma mark Public

/*!
 @brief Creates this, sorting missing values first.
 */
- (instancetype __nonnull)initWithInt:(jint)numHits
                         withNSString:(NSString *)field;

/*!
 @brief Creates this, with control over how missing values
   are sorted.Pass sortMissingLast=true to put
   missing values at the end.
 */
- (instancetype __nonnull)initWithInt:(jint)numHits
                         withNSString:(NSString *)field
                          withBoolean:(jboolean)sortMissingLast;

- (jint)compareWithInt:(jint)slot1
               withInt:(jint)slot2;

- (jint)compareBottomWithInt:(jint)doc;

- (jint)compareTopWithInt:(jint)doc;

- (jint)compareValuesWithId:(OrgApacheLuceneUtilBytesRef *)val1
                     withId:(OrgApacheLuceneUtilBytesRef *)val2;

- (void)copy__WithInt:(jint)slot
              withInt:(jint)doc OBJC_METHOD_FAMILY_NONE;

- (id<OrgApacheLuceneSearchLeafFieldComparator>)getLeafComparatorWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context;

- (void)setBottomWithInt:(jint)bottom;

- (void)setScorerWithOrgApacheLuceneSearchScorer:(OrgApacheLuceneSearchScorer *)scorer;

- (void)setTopValueWithId:(OrgApacheLuceneUtilBytesRef *)value;

- (OrgApacheLuceneUtilBytesRef *)valueWithInt:(jint)slot;

#pragma mark Protected

/*!
 @brief Retrieves the SortedDocValues for the field in this segment
 */
- (OrgApacheLuceneIndexSortedDocValues *)getSortedDocValuesWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context
                                                                                        withNSString:(NSString *)field;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)init NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator)

J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator, ords_, IOSIntArray *)
J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator, values_, IOSObjectArray *)
J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator, readerGen_, IOSIntArray *)
J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator, termsIndex_, OrgApacheLuceneIndexSortedDocValues *)
J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator, bottomValue_, OrgApacheLuceneUtilBytesRef *)
J2OBJC_FIELD_SETTER(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator, topValue_, OrgApacheLuceneUtilBytesRef *)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_TermOrdValComparator_initWithInt_withNSString_(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator *self, jint numHits, NSString *field);

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_TermOrdValComparator *new_OrgApacheLuceneSearchFieldComparator_TermOrdValComparator_initWithInt_withNSString_(jint numHits, NSString *field) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_TermOrdValComparator *create_OrgApacheLuceneSearchFieldComparator_TermOrdValComparator_initWithInt_withNSString_(jint numHits, NSString *field);

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_TermOrdValComparator_initWithInt_withNSString_withBoolean_(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator *self, jint numHits, NSString *field, jboolean sortMissingLast);

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_TermOrdValComparator *new_OrgApacheLuceneSearchFieldComparator_TermOrdValComparator_initWithInt_withNSString_withBoolean_(jint numHits, NSString *field, jboolean sortMissingLast) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_TermOrdValComparator *create_OrgApacheLuceneSearchFieldComparator_TermOrdValComparator_initWithInt_withNSString_withBoolean_(jint numHits, NSString *field, jboolean sortMissingLast);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator_TermOrdValComparator)

#endif

#if !defined (OrgApacheLuceneSearchFieldComparator_TermValComparator_) && (INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator || defined(INCLUDE_OrgApacheLuceneSearchFieldComparator_TermValComparator))
#define OrgApacheLuceneSearchFieldComparator_TermValComparator_

#define RESTRICT_OrgApacheLuceneSearchLeafFieldComparator 1
#define INCLUDE_OrgApacheLuceneSearchLeafFieldComparator 1
#include "org/apache/lucene/search/LeafFieldComparator.h"

@class OrgApacheLuceneIndexBinaryDocValues;
@class OrgApacheLuceneIndexLeafReaderContext;
@class OrgApacheLuceneSearchScorer;
@class OrgApacheLuceneUtilBytesRef;
@protocol OrgApacheLuceneUtilBits;

/*!
 @brief Sorts by field's natural Term sort order.All
   comparisons are done using BytesRef.compareTo, which is
   slow for medium to large result sets but possibly
   very fast for very small results sets.
 */
@interface OrgApacheLuceneSearchFieldComparator_TermValComparator : OrgApacheLuceneSearchFieldComparator < OrgApacheLuceneSearchLeafFieldComparator >

#pragma mark Public

/*!
 @brief Sole constructor.
 */
- (instancetype __nonnull)initWithInt:(jint)numHits
                         withNSString:(NSString *)field
                          withBoolean:(jboolean)sortMissingLast;

- (jint)compareWithInt:(jint)slot1
               withInt:(jint)slot2;

- (jint)compareBottomWithInt:(jint)doc;

- (jint)compareTopWithInt:(jint)doc;

- (jint)compareValuesWithId:(OrgApacheLuceneUtilBytesRef *)val1
                     withId:(OrgApacheLuceneUtilBytesRef *)val2;

- (void)copy__WithInt:(jint)slot
              withInt:(jint)doc OBJC_METHOD_FAMILY_NONE;

- (id<OrgApacheLuceneSearchLeafFieldComparator>)getLeafComparatorWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context;

- (void)setBottomWithInt:(jint)bottom;

- (void)setScorerWithOrgApacheLuceneSearchScorer:(OrgApacheLuceneSearchScorer *)scorer;

- (void)setTopValueWithId:(OrgApacheLuceneUtilBytesRef *)value;

- (OrgApacheLuceneUtilBytesRef *)valueWithInt:(jint)slot;

#pragma mark Protected

/*!
 @brief Retrieves the BinaryDocValues for the field in this segment
 */
- (OrgApacheLuceneIndexBinaryDocValues *)getBinaryDocValuesWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context
                                                                                        withNSString:(NSString *)field;

/*!
 @brief Retrieves the set of documents that have a value in this segment
 */
- (id<OrgApacheLuceneUtilBits>)getDocsWithFieldWithOrgApacheLuceneIndexLeafReaderContext:(OrgApacheLuceneIndexLeafReaderContext *)context
                                                                            withNSString:(NSString *)field;

/*!
 @brief Check whether the given value represents <tt>null</tt>.This can be
   useful if the <code>BinaryDocValues</code> returned by <code>getBinaryDocValues</code>
   use a special value as a sentinel.
 The default implementation checks  
 <code>getDocsWithField</code>.
   <p>NOTE: The null value can only be an EMPTY <code>BytesRef</code>.
 */
- (jboolean)isNullWithInt:(jint)doc
withOrgApacheLuceneUtilBytesRef:(OrgApacheLuceneUtilBytesRef *)term;

// Disallowed inherited constructors, do not use.

- (instancetype __nonnull)init NS_UNAVAILABLE;

@end

J2OBJC_EMPTY_STATIC_INIT(OrgApacheLuceneSearchFieldComparator_TermValComparator)

FOUNDATION_EXPORT void OrgApacheLuceneSearchFieldComparator_TermValComparator_initWithInt_withNSString_withBoolean_(OrgApacheLuceneSearchFieldComparator_TermValComparator *self, jint numHits, NSString *field, jboolean sortMissingLast);

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_TermValComparator *new_OrgApacheLuceneSearchFieldComparator_TermValComparator_initWithInt_withNSString_withBoolean_(jint numHits, NSString *field, jboolean sortMissingLast) NS_RETURNS_RETAINED;

FOUNDATION_EXPORT OrgApacheLuceneSearchFieldComparator_TermValComparator *create_OrgApacheLuceneSearchFieldComparator_TermValComparator_initWithInt_withNSString_withBoolean_(jint numHits, NSString *field, jboolean sortMissingLast);

J2OBJC_TYPE_LITERAL_HEADER(OrgApacheLuceneSearchFieldComparator_TermValComparator)

#endif


#if __has_feature(nullability)
#pragma clang diagnostic pop
#endif
#pragma pop_macro("INCLUDE_ALL_OrgApacheLuceneSearchFieldComparator")
