public class NameComparator extends Object implements Comparator<NameIF>
Modifier and Type | Field and Description |
---|---|
protected Collection<TopicIF> |
scopes |
protected VariantNameGrabber |
sortNameGrabber |
protected VariantNameGrabber |
vnGrabber |
Constructor and Description |
---|
NameComparator()
Empty constructor, used on application startup to initialise a
"fast" comparator which will compare TopicNameIFs and
VariantNameIFs using no context.
|
NameComparator(Collection<TopicIF> context)
Constructor used to make a comparator which will compare
TopicNameIFs and VariantNameIFs using the context provided.
|
Modifier and Type | Method and Description |
---|---|
int |
compare(NameIF o1,
NameIF o2)
Compares two TopicNameIFs / VariantNameIFs.
|
protected String |
getName(NameIF 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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected Collection<TopicIF> scopes
protected VariantNameGrabber vnGrabber
protected VariantNameGrabber sortNameGrabber
public NameComparator()
public NameComparator(Collection<TopicIF> context)
protected final void initSortNameGrabber(TMObjectIF tmObj)
protected String getName(NameIF obj)
public int compare(NameIF o1, NameIF o2)
compare
in interface Comparator<NameIF>