Class ContextNameGrabber
- java.lang.Object
-
- net.ontopia.topicmaps.nav.utils.comparators.ContextNameGrabber
-
public class ContextNameGrabber extends Object implements Function<TopicIF,NameIF>
INTERNAL: Grabber that grabs the most appropriate basename from a topic and then the most appropriate variant name, if one can be found. If no better variant name can be found, the base name is used. This class is much used for grabbing display and sort names.
-
-
Field Summary
Fields Modifier and Type Field Description protected Comparator<TopicNameIF>
bnComparator
protected Comparator<VariantNameIF>
vnComparator
protected Predicate<VariantNameIF>
within
-
Constructor Summary
Constructors Constructor Description ContextNameGrabber(Collection<TopicIF> baseNameContext, Collection<TopicIF> variantNameContext)
INTERNAL: Creates a grabber; makes the comparators ScopedIFComparator for the given scopes.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NameIF
apply(TopicIF mytopic)
INTERNAL: Grabs the most appropriate base name for the given topic, using the comparator established at creation to compare available base names and if a sort variant is available it will be used.
-
-
-
Field Detail
-
within
protected Predicate<VariantNameIF> within
-
bnComparator
protected Comparator<TopicNameIF> bnComparator
-
vnComparator
protected Comparator<VariantNameIF> vnComparator
-
-
Constructor Detail
-
ContextNameGrabber
public ContextNameGrabber(Collection<TopicIF> baseNameContext, Collection<TopicIF> variantNameContext)
INTERNAL: Creates a grabber; makes the comparators ScopedIFComparator for the given scopes.- Parameters:
baseNameContext
- basename scope; a collection of TopicIF objects.variantNameContext
- variantname scope; a collection of TopicIF objects.
-
-