net.ontopia.topicmaps.nav.utils.comparators
Class OccurrenceComparator

java.lang.Object
  extended by net.ontopia.topicmaps.nav.utils.comparators.OccurrenceComparator
All Implemented Interfaces:
Comparator<OccurrenceIF>

public class OccurrenceComparator
extends Object
implements Comparator<OccurrenceIF>

INTERNAL: A Comparator for ordering OccurrenceIFs alphabetically.


Field Summary
protected  Comparator<TopicIF> tc
           
 
Constructor Summary
OccurrenceComparator()
          Empty constructor, used on application startup to initialise a "fast" comparator which will compare Occurrences using no context.
OccurrenceComparator(Collection<TopicIF> baseNameContext)
          Constructor used to make a comparator which will compare Occurrences using the context provided.
OccurrenceComparator(Collection<TopicIF> baseNameContext, Collection<TopicIF> variantContext)
          Constructor used to make a comparator which will compare Occurrences using the context provided.
 
Method Summary
 int compare(OccurrenceIF oc1, OccurrenceIF oc2)
          Compares two OccurrenceIFs.
 
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

tc

protected Comparator<TopicIF> tc
Constructor Detail

OccurrenceComparator

public OccurrenceComparator()
Empty constructor, used on application startup to initialise a "fast" comparator which will compare Occurrences using no context.


OccurrenceComparator

public OccurrenceComparator(Collection<TopicIF> baseNameContext)
Constructor used to make a comparator which will compare Occurrences using the context provided.


OccurrenceComparator

public OccurrenceComparator(Collection<TopicIF> baseNameContext,
                            Collection<TopicIF> variantContext)
Constructor used to make a comparator which will compare Occurrences using the context provided.

Method Detail

compare

public int compare(OccurrenceIF oc1,
                   OccurrenceIF oc2)
Compares two OccurrenceIFs.

Specified by:
compare in interface Comparator<OccurrenceIF>


Copyright © 2000-2012 Ontopia.