org.apache.solr.client.solrj.io.comp

## Class FieldComparator

- java.lang.Object
- - org.apache.solr.client.solrj.io.comp.StreamComparator
  - - org.apache.solr.client.solrj.io.comp.FieldComparator

All Implemented Interfaces:
  Serializable, Comparator<Tuple>, ExpressibleComparator

    public class FieldComparator
    extends StreamComparator
    implements Comparator<Tuple>, ExpressibleComparator, Serializable

An equality field Comparator which compares a field of two Tuples and determines sort order.

See Also:
  Serialized Form

### Field Summary

### Fields inherited from class org.apache.solr.client.solrj.io.comp.StreamComparator

`leftField, order, rightField`

### Constructor Summary

Constructors
Constructor and Description
`FieldComparator(String field, ComparatorOrder order)`
`FieldComparator(String leftField, String rightField, ComparatorOrder order)`

### Method Summary

Methods
`int` `compare(Tuple leftTuple, Tuple rightTuple)`
`StreamExpressionParameter` `toExpression(StreamFactory factory)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.util.Comparator

`equals`

### Constructor Detail

#### FieldComparator

    public FieldComparator(String field,
                   ComparatorOrder order)

#### FieldComparator

    public FieldComparator(String leftField,
                   String rightField,
                   ComparatorOrder order)

### Method Detail

#### toExpression

    public StreamExpressionParameter toExpression(StreamFactory factory)

Specified by:
  `toExpression` in interface `ExpressibleComparator`

#### compare

    public int compare(Tuple leftTuple,
              Tuple rightTuple)

Specified by:
  `compare` in interface `Comparator<Tuple>`