Class FieldComparator
- java.lang.Object
-
- org.apache.solr.client.solrj.io.comp.FieldComparator
-
- All Implemented Interfaces:
Serializable
,Comparator<Tuple>
,StreamComparator
,Expressible
public class FieldComparator extends Object implements StreamComparator
An equality field Comparator which compares a field of two Tuples and determines sort order.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description FieldComparator(String leftFieldName, String rightFieldName, ComparatorOrder order)
FieldComparator(String fieldName, ComparatorOrder order)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StreamComparator
append(StreamComparator other)
int
compare(Tuple leftTuple, Tuple rightTuple)
FieldComparator
copyAliased(Map<String,String> aliases)
boolean
equals(Object o)
String
getLeftFieldName()
ComparatorOrder
getOrder()
String
getRightFieldName()
boolean
hasDifferentFieldNames()
int
hashCode()
boolean
isDerivedFrom(StreamComparator base)
void
setLeftFieldName(String leftFieldName)
void
setRightFieldName(String rightFieldName)
Explanation
toExplanation(StreamFactory factory)
Returns an explanation about the stream objectStreamExpressionParameter
toExpression(StreamFactory factory)
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
FieldComparator
public FieldComparator(String fieldName, ComparatorOrder order)
-
FieldComparator
public FieldComparator(String leftFieldName, String rightFieldName, ComparatorOrder order)
-
-
Method Detail
-
setLeftFieldName
public void setLeftFieldName(String leftFieldName)
-
getLeftFieldName
public String getLeftFieldName()
-
setRightFieldName
public void setRightFieldName(String rightFieldName)
-
getRightFieldName
public String getRightFieldName()
-
getOrder
public ComparatorOrder getOrder()
-
hasDifferentFieldNames
public boolean hasDifferentFieldNames()
-
toExpression
public StreamExpressionParameter toExpression(StreamFactory factory)
- Specified by:
toExpression
in interfaceExpressible
-
toExplanation
public Explanation toExplanation(StreamFactory factory) throws IOException
Description copied from interface:Expressible
Returns an explanation about the stream object- Specified by:
toExplanation
in interfaceExpressible
- Parameters:
factory
- Stream factory for this, contains information about the function name- Returns:
- Explanation about this stream object containing explanations of any child stream objects
- Throws:
IOException
- throw on any error
-
compare
public int compare(Tuple leftTuple, Tuple rightTuple)
- Specified by:
compare
in interfaceComparator<Tuple>
-
isDerivedFrom
public boolean isDerivedFrom(StreamComparator base)
- Specified by:
isDerivedFrom
in interfaceStreamComparator
-
copyAliased
public FieldComparator copyAliased(Map<String,String> aliases)
- Specified by:
copyAliased
in interfaceStreamComparator
-
append
public StreamComparator append(StreamComparator other)
- Specified by:
append
in interfaceStreamComparator
-
equals
public boolean equals(Object o)
- Specified by:
equals
in interfaceComparator<Tuple>
- Overrides:
equals
in classObject
-
-