Class ThemeCategorizer
- java.lang.Object
-
- net.ontopia.topicmaps.nav.context.ThemeCategorizer
-
public class ThemeCategorizer extends Object
INTERNAL: Class for categorizing a collection of themes according to their theme class. The theme classes as well as the themes in each theme class could be sorted.
-
-
Field Summary
Fields Modifier and Type Field Description protected Comparator
lexicalComparator
for sorting the theme class stringsprotected static String
STRING_NO_CLASS
representation of theme class for themes which belong to no typeprotected Function<TopicIF,String>
stringifier
Stringifier for theme class topicsprotected Comparator
topicComparator
for sorting the theme topics
-
Constructor Summary
Constructors Constructor Description ThemeCategorizer(TopicMapIF tm, Collection context)
empty constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
generateThemeList(HashMap themeClassMap, Collection selectedThemes, String templThemeClass, String templTheme, String templSelectedTheme)
Generate a ordered list of theme classes.String
generateThemeList(HashMap themeClassMap, Collection selectedThemes, Function<String,String> stringifierThemeClass, Function<TopicIF,String> stringifierTheme, Function<TopicIF,String> stringifierSelectedTheme)
Generate a ordered list of theme classes.String
generateThemeList(HashMap themeClassMap, Function<String,String> stringifierThemeClass, Function<TopicIF,String> stringifierTheme)
Generate a ordered list of theme classes.HashMap
getThemeClasses(Collection themes)
processthemes
and generate HashMap which reflects theme categories.Function<TopicIF,String>
getTopicStringifier()
INTERNAL: Returns the internal stringifier used to stringify topics correctly in the current context.
-
-
-
Field Detail
-
STRING_NO_CLASS
protected static final String STRING_NO_CLASS
representation of theme class for themes which belong to no type- See Also:
- Constant Field Values
-
lexicalComparator
protected Comparator lexicalComparator
for sorting the theme class strings
-
topicComparator
protected Comparator topicComparator
for sorting the theme topics
-
-
Constructor Detail
-
ThemeCategorizer
public ThemeCategorizer(TopicMapIF tm, Collection context)
empty constructor.
-
-
Method Detail
-
getTopicStringifier
public Function<TopicIF,String> getTopicStringifier()
INTERNAL: Returns the internal stringifier used to stringify topics correctly in the current context.
-
getThemeClasses
public HashMap getThemeClasses(Collection themes)
processthemes
and generate HashMap which reflects theme categories.- Returns:
- HashMap which contains as keys Strings of the theme type that lead to HasSet objects. These store TopicIF objects for the themes.
-
generateThemeList
public String generateThemeList(HashMap themeClassMap, Function<String,String> stringifierThemeClass, Function<TopicIF,String> stringifierTheme)
Generate a ordered list of theme classes. Note: In every theme class there are at least one theme.
-
generateThemeList
public String generateThemeList(HashMap themeClassMap, Collection selectedThemes, Function<String,String> stringifierThemeClass, Function<TopicIF,String> stringifierTheme, Function<TopicIF,String> stringifierSelectedTheme)
Generate a ordered list of theme classes. The themes which are found in the collection of selectedThemes use their own stringifierstringifierSelectedTheme
. Note: In every theme class there are at least one theme.
-
generateThemeList
public String generateThemeList(HashMap themeClassMap, Collection selectedThemes, String templThemeClass, String templTheme, String templSelectedTheme)
Generate a ordered list of theme classes. Use template strings to render result string, this approach is used by the navigator framework 2nd generation. Note: In every theme class there are at least one theme.
-
-