de.topicmapslab.majortom.comparator
Class VariantByValueComparator

java.lang.Object
  extended by de.topicmapslab.majortom.comparator.VariantByValueComparator
All Implemented Interfaces:
java.util.Comparator<org.tmapi.core.Variant>

public class VariantByValueComparator
extends java.lang.Object
implements java.util.Comparator<org.tmapi.core.Variant>

Variant comparator

Author:
Sven Krosse

Field Summary
private  boolean ascending
           
private static VariantByValueComparator instanceAsc
           
private static VariantByValueComparator instanceDesc
           
 
Constructor Summary
VariantByValueComparator(boolean ascending)
          constructor
 
Method Summary
 int compare(org.tmapi.core.Variant o1, org.tmapi.core.Variant o2)
          
static VariantByValueComparator getInstance(boolean ascending)
          Returns the singleton instance of the comparator
 
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

instanceAsc

private static VariantByValueComparator instanceAsc

instanceDesc

private static VariantByValueComparator instanceDesc

ascending

private final boolean ascending
Constructor Detail

VariantByValueComparator

public VariantByValueComparator(boolean ascending)
constructor

Parameters:
ascending - sorting order ascending?
Method Detail

getInstance

public static VariantByValueComparator getInstance(boolean ascending)
Returns the singleton instance of the comparator

Parameters:
ascending - sorting order ascending?
Returns:
the instance the comparator instance

compare

public int compare(org.tmapi.core.Variant o1,
                   org.tmapi.core.Variant o2)

Specified by:
compare in interface java.util.Comparator<org.tmapi.core.Variant>