|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.ontopia.topicmaps.nav.utils.comparators.NameComparator
public class NameComparator
INTERNAL: A Comparator for ordering TopicNameIFs and VariantNameIFs alphabetically (case-independent).
Field Summary | |
---|---|
protected java.util.Collection |
scopes
|
protected static URILocator |
SORT_LOCATOR
|
protected VariantNameGrabber |
sortNameGrabber
|
protected VariantNameGrabber |
vnGrabber
|
Constructor Summary | |
---|---|
NameComparator()
Empty constructor, used on application startup to initialise a "fast" comparator which will compare TopicNameIFs and VariantNameIFs using no context. |
|
NameComparator(java.util.Collection context)
Constructor used to make a comparator which will compare TopicNameIFs and VariantNameIFs using the context provided. |
Method Summary | |
---|---|
int |
compare(java.lang.Object o1,
java.lang.Object o2)
Compares two TopicNameIFs / VariantNameIFs. |
protected java.lang.String |
getName(java.lang.Object obj)
INTERNAL: helper method which gets out of the object the base name or variant name value. |
protected void |
initSortNameGrabber(TMObjectIF tmObj)
INTERNAL: setup variant sort name grabber. |
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 |
---|
protected java.util.Collection scopes
protected VariantNameGrabber vnGrabber
protected VariantNameGrabber sortNameGrabber
protected static final URILocator SORT_LOCATOR
Constructor Detail |
---|
public NameComparator()
public NameComparator(java.util.Collection context)
Method Detail |
---|
protected final void initSortNameGrabber(TMObjectIF tmObj)
protected java.lang.String getName(java.lang.Object obj) throws java.lang.ClassCastException
java.lang.ClassCastException
public int compare(java.lang.Object o1, java.lang.Object o2)
compare
in interface java.util.Comparator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |