Class 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 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)
        process themes 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 stringifier stringifierSelectedTheme. 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.