net.ontopia.topicmaps.utils
Class TypedIFComparator

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

public class TypedIFComparator
extends Object
implements 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.


Field Summary
protected  Comparator subcomparator
          INTERNAL: The comparator used to compare the types
 
Constructor Summary
TypedIFComparator(Comparator subcomparator)
          INTERNAL: Creates a TypedIfComparator which uses the given comparator
 
Method Summary
 int compare(Object obj1, Object obj2)
          INTERNAL: Compares the given typedIF objects using the comparator given to the constructor
 
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

subcomparator

protected Comparator subcomparator
INTERNAL: The comparator used to compare the types

Constructor Detail

TypedIFComparator

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

Parameters:
subcomparator - the given comparator
Method Detail

compare

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

Specified by:
compare in interface 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-2012 Ontopia.