de.topicmapslab.majortom.comparator
Class OccurrenceByValueComparator

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

public class OccurrenceByValueComparator
extends java.lang.Object
implements java.util.Comparator<org.tmapi.core.Occurrence>

Occurrence comparator

Author:
Sven Krosse

Field Summary
private  boolean ascending
           
private static OccurrenceByValueComparator instanceAsc
           
private static OccurrenceByValueComparator instanceDesc
           
 
Constructor Summary
private OccurrenceByValueComparator(boolean ascending)
          constructor
 
Method Summary
 int compare(org.tmapi.core.Occurrence o1, org.tmapi.core.Occurrence o2)
          
static OccurrenceByValueComparator 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 OccurrenceByValueComparator instanceAsc

instanceDesc

private static OccurrenceByValueComparator instanceDesc

ascending

private final boolean ascending
Constructor Detail

OccurrenceByValueComparator

private OccurrenceByValueComparator(boolean ascending)
constructor

Parameters:
ascending - sorting order ascending?
Method Detail

getInstance

public static OccurrenceByValueComparator 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.Occurrence o1,
                   org.tmapi.core.Occurrence o2)

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