net.ontopia.topicmaps.utils
Class TypedIFComparator

java.lang.Object
  extended by net.ontopia.topicmaps.utils.TypedIFComparator
All Implemented Interfaces:
java.util.Comparator

public class TypedIFComparator
extends java.lang.Object
implements java.util.Comparator

INTERNAL: Comparator that grabs the type of the comparable objects using TypedIF.getType() , and passes those two topics to it's subcomparator. Note that this comparator may only be used with objects that implement TypedIF.


Constructor Summary
TypedIFComparator(java.util.Comparator subcomparator)
          INTERNAL: Creates a TypedIfComparator which uses the given comparator
 
Method Summary
 int compare(java.lang.Object obj1, java.lang.Object obj2)
          INTERNAL: Compares the given typedIF objects using the comparator given to the constructor
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

TypedIFComparator

public TypedIFComparator(java.util.Comparator subcomparator)
INTERNAL: Creates a TypedIfComparator which uses the given comparator

Parameters:
subcomparator - the given comparator
Method Detail

compare

public int compare(java.lang.Object obj1,
                   java.lang.Object obj2)
INTERNAL: Compares the given typedIF objects using the comparator given to the constructor

Specified by:
compare in interface java.util.Comparator
Parameters:
obj1 - an object; typecast to TypedIF by the grabber
obj2 - an object; typecast to TypedIF by the grabber
Returns:
int; result from the comparator given to the constructor, when it compares the types of the given objects


Copyright © 2000-2009 Ontopia.