de.topicmapslab.majortom.comparator
Class LocatorByReferenceComparator

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

public class LocatorByReferenceComparator
extends java.lang.Object
implements java.util.Comparator<org.tmapi.core.Locator>

Locator comparator

Author:
Sven Krosse

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

instanceDesc

private static LocatorByReferenceComparator instanceDesc

ascending

private final boolean ascending
Constructor Detail

LocatorByReferenceComparator

private LocatorByReferenceComparator(boolean ascending)
constructor

Parameters:
ascending - sorting order ascending?
Method Detail

getInstance

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

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