org.openanzo.glitter.query
Class PatternSolutionImpl.SetSolutionComparator

java.lang.Object
  extended by org.openanzo.glitter.query.PatternSolutionImpl.SetSolutionComparator
All Implemented Interfaces:
java.util.Comparator<PatternSolution>
Enclosing class:
PatternSolutionImpl

public static class PatternSolutionImpl.SetSolutionComparator
extends java.lang.Object
implements java.util.Comparator<PatternSolution>

Used to provide a stable sort to two PatternSolutions. This orders a solution with a common term (from the other solution set) first if the other solution doesn't contain that bindable... It ensures that solutions with common terms are earlier in the sort order.

Author:
lee

Constructor Summary
PatternSolutionImpl.SetSolutionComparator(java.util.Set<Bindable> matches)
           
 
Method Summary
 int compare(PatternSolution o1, PatternSolution o2)
           
 
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

PatternSolutionImpl.SetSolutionComparator

public PatternSolutionImpl.SetSolutionComparator(java.util.Set<Bindable> matches)
Parameters:
matches - The set of variables and blank nodes that are in common between the solutions being sorted.
Method Detail

compare

public int compare(PatternSolution o1,
                   PatternSolution o2)
Specified by:
compare in interface java.util.Comparator<PatternSolution>


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