JSHOP2
Class CompLess

java.lang.Object
  extended by JSHOP2.CompLess
All Implemented Interfaces:
java.util.Comparator<Term[]>

public class CompLess
extends java.lang.Object
implements java.util.Comparator<Term[]>

This class handles :sort-by logical preconditions that use numerical less than as the sorting function.

Version:
1.0.3
Author:
Okhtay Ilghami, http://www.cs.umd.edu/~okhtay

Field Summary
private  int varIdx
          The index of the variable according to the value of which the satisfiers should be sorted.
 
Constructor Summary
CompLess(int varIdxIn)
          To initialize this object.
 
Method Summary
 int compare(Term[] t1, Term[] t2)
          The function that implements the actual comparison.
 
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
 

Field Detail

varIdx

private int varIdx
The index of the variable according to the value of which the satisfiers should be sorted.

Constructor Detail

CompLess

public CompLess(int varIdxIn)
To initialize this object.

Parameters:
varIdxIn - The index of the variable according to the value of which the satisfiers should be sorted.
Method Detail

compare

public int compare(Term[] t1,
                   Term[] t2)
The function that implements the actual comparison.

Specified by:
compare in interface java.util.Comparator<Term[]>
Parameters:
t1 - the first binding.
t2 - the second binding.
Returns:
-1 if the first binding should come first, 1 if the second binding should come first, 0 if the variable according to value of which the satisfiers are being sorted has the same value in these two bindings.