use of javax.jcr.query.qom.Operand in project jackrabbit by apache.
the class RowComparator method compare.
public int compare(Row a, Row b) {
try {
for (Ordering ordering : orderings) {
Operand operand = ordering.getOperand();
Value[] va = evaluator.getValues(operand, a);
Value[] vb = evaluator.getValues(operand, b);
int d = comparator.compare(va, vb);
if (d != 0) {
if (JCR_ORDER_DESCENDING.equals(ordering.getOrder())) {
return -d;
} else {
return d;
}
}
}
return 0;
} catch (RepositoryException e) {
throw new RuntimeException("Unable to compare rows " + a + " and " + b, e);
}
}
Aggregations