de.topicmapslab.majortom.io
Class CXTMTopicMapWriter.AbstractSetComparator<T>

java.lang.Object
  extended by de.topicmapslab.majortom.io.CXTMTopicMapWriter.AbstractSetComparator<T>
All Implemented Interfaces:
java.util.Comparator<java.util.Set<T>>
Direct Known Subclasses:
CXTMTopicMapWriter.LocatorSetComparator, CXTMTopicMapWriter.RoleSetComparator, CXTMTopicMapWriter.ScopeComparator
Enclosing class:
CXTMTopicMapWriter

private abstract class CXTMTopicMapWriter.AbstractSetComparator<T>
extends java.lang.Object
implements java.util.Comparator<java.util.Set<T>>

Comparator which compares the size of the provided set. Iff the size of the sets are equal, another comparison method is used to compare the content of the sets.


Constructor Summary
private CXTMTopicMapWriter.AbstractSetComparator()
           
 
Method Summary
 int compare(java.util.Set<T> o1, java.util.Set<T> o2)
           
(package private) abstract  int compareContent(java.util.Set<T> o1, java.util.Set<T> o2, int size)
          Called iff the size of the sets is equal.
 
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
 

Constructor Detail

CXTMTopicMapWriter.AbstractSetComparator

private CXTMTopicMapWriter.AbstractSetComparator()
Method Detail

compare

public int compare(java.util.Set<T> o1,
                   java.util.Set<T> o2)
Specified by:
compare in interface java.util.Comparator<java.util.Set<T>>

compareContent

abstract int compareContent(java.util.Set<T> o1,
                            java.util.Set<T> o2,
                            int size)
Called iff the size of the sets is equal. This method is used to compare the content of the sets.

Parameters:
o1 - The first set.
o2 - The second set.
size - The size of the set(s).
Returns:
A negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.