gov.nih.nlm.umls.meta
Class Atom.AtomRankComparator

java.lang.Object
  extended bygov.nih.nlm.umls.meta.Atom.AtomRankComparator
All Implemented Interfaces:
Comparator
Enclosing class:
Atom

public static final class Atom.AtomRankComparator
extends Object
implements Comparator

Sorts the atoms.


Constructor Summary
Atom.AtomRankComparator(Atom[] atoms, SourceTermType[] prec, boolean lat_flag, boolean sui_flag, boolean lui_flag)
          Constructor
 
Method Summary
 int compare(Object o1, Object o2)
          Compare the two atoms based on the ranks stored previously.
 void setAtoms(Atom[] atoms)
          This method initializes the comparator with a new Concept.
 
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

Atom.AtomRankComparator

public Atom.AtomRankComparator(Atom[] atoms,
                               SourceTermType[] prec,
                               boolean lat_flag,
                               boolean sui_flag,
                               boolean lui_flag)
                        throws Exception
Constructor

Parameters:
atoms - a Atom[] containing atoms to compare
prec - SourceTermType[]
lat_flag - a flag indicating whether or not to sort by LAT
sui_flag - a flag indicating whether or not to sort by SUI
lui_flag - a flag indicating whether or not to sort by LUI
Throws:
Exception
Method Detail

setAtoms

public void setAtoms(Atom[] atoms)
This method initializes the comparator with a new Concept.

Parameters:
atoms - a new Atom[]

compare

public int compare(Object o1,
                   Object o2)
Compare the two atoms based on the ranks stored previously.

Specified by:
compare in interface Comparator
Parameters:
o1 - Object 1 to compare
o2 - Object 2 to compare
Returns:
an int for the relative ordering


Copyright ©2005