org.openanzo.glitter.query
Class SolutionSorter

java.lang.Object
  extended by org.openanzo.glitter.query.SolutionSorter
All Implemented Interfaces:
java.util.Comparator<PatternSolution>

public class SolutionSorter
extends java.lang.Object
implements java.util.Comparator<PatternSolution>

Sorts solutions according to a given list of OrderingConditions.

Author:
lee

Constructor Summary
SolutionSorter(java.util.List<OrderingCondition> conditions)
          Constructor.
 
Method Summary
 int compare(PatternSolution c1, PatternSolution c2)
          Compares two solutions by evaluating the ordering expressions in the context of the two solutions.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

SolutionSorter

public SolutionSorter(java.util.List<OrderingCondition> conditions)
Constructor.

Parameters:
conditions -
Method Detail

compare

public int compare(PatternSolution c1,
                   PatternSolution c2)
Compares two solutions by evaluating the ordering expressions in the context of the two solutions. The SPARQL specification defines rules for comparing various pairs of RDF term values to derive a proper ordering.

Specified by:
compare in interface java.util.Comparator<PatternSolution>


Copyright © 2007 Cambridge Semantics Inc.. All Rights Reserved.