org.openscience.nmrshiftdb.util
Class ValueTripleComparator

java.lang.Object
  extended by org.openscience.nmrshiftdb.util.ValueTripleComparator
All Implemented Interfaces:
java.util.Comparator

public class ValueTripleComparator
extends java.lang.Object
implements java.util.Comparator

This is implememtation of Comparator used for sorting ValueTriples accoring to the distance to a value given in ValueTriple as ComparatorValue

Author:
shk3

Field Summary
(package private)  boolean descending
           
 
Constructor Summary
ValueTripleComparator()
          Constructor for the ValueTripleComparator object
ValueTripleComparator(boolean descending)
          Constructor for the ValueTripleComparator object
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
          The compare method
 
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

descending

boolean descending
Constructor Detail

ValueTripleComparator

public ValueTripleComparator()
Constructor for the ValueTripleComparator object


ValueTripleComparator

public ValueTripleComparator(boolean descending)
Constructor for the ValueTripleComparator object

Parameters:
descending - Should sorting be done descending?
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
The compare method

Specified by:
compare in interface java.util.Comparator
Parameters:
obj1 - The first ValueTriple
obj2 - The second ValueTriple
Returns:
-1,0,1