gov.nih.nlm.umls.meta
Class Atom.AtomRankComparator
java.lang.Object
gov.nih.nlm.umls.meta.Atom.AtomRankComparator
- All Implemented Interfaces:
- Comparator
- Enclosing interface:
- Atom
public static final class Atom.AtomRankComparator
- extends Object
- implements Comparator
Sorts the atoms.
|
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 |
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 compareprec - SourceTermType[]lat_flag - a flag indicating whether or not to sort by LATsui_flag - a flag indicating whether or not to sort by SUIlui_flag - a flag indicating whether or not to sort by LUI
- Throws:
Exception
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 compareo2 - Object 2 to compare
- Returns:
- an
int for the relative ordering
Copyright ©2005