de.topicmapslab.majortom.comparator
Class NameByValueComparator

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

public class NameByValueComparator
extends java.lang.Object
implements java.util.Comparator<org.tmapi.core.Name>

Name comparator

Author:
Sven Krosse

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

instanceDesc

private static NameByValueComparator instanceDesc

ascending

private final boolean ascending
Constructor Detail

NameByValueComparator

private NameByValueComparator(boolean ascending)
constructor

Parameters:
ascending - sorting order ascending?
Method Detail

getInstance

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

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