Class PathTopic

  • All Implemented Interfaces:
    Topic
    Direct Known Subclasses:
    FileTopic, HeaderTopic

    public abstract class PathTopic
    extends java.lang.Object
    implements Topic
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String name  
      protected java.nio.file.Path path  
      protected java.util.LinkedList<Topic> subTopics  
    • Constructor Summary

      Constructors 
      Constructor Description
      PathTopic​(java.nio.file.Path path)  
    • Method Summary

      Modifier and Type Method Description
      void addSubTopic​(Topic topic)
      Add a subtopic to this topic.
      void addSubTopics​(java.util.Collection<Topic> topics)  
      java.lang.String getId()
      Return the self-same generated ref id that will be rendered in HTML.
      int getLevel()
      Get a level associated with this topic.
      java.lang.String getName()  
      java.lang.String getPath()  
      java.util.LinkedList<Topic> getSubTopics()
      Get subtopics that are associated with this topic, or contained by this topic.
      void setLevel​(int level)  
      void setName​(java.lang.String name)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • path

        protected final java.nio.file.Path path
      • name

        protected java.lang.String name
      • subTopics

        protected java.util.LinkedList<Topic> subTopics
    • Constructor Detail

      • PathTopic

        public PathTopic​(java.nio.file.Path path)
    • Method Detail

      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Topic
      • getId

        public java.lang.String getId()
        Return the self-same generated ref id that will be rendered in HTML. The rendered HTML and the parsed model of the markdown use the same generator scheme.
        Specified by:
        getId in interface Topic
        Returns:
        A simple text based ref id
      • getPath

        public java.lang.String getPath()
        Specified by:
        getPath in interface Topic
        Returns:
        the logical path associated with this topic, without the extension.
      • getLevel

        public int getLevel()
        Description copied from interface: Topic
        Get a level associated with this topic. Lower numbers represent broader topics. The is akin to "indentation level".
        Specified by:
        getLevel in interface Topic
        Returns:
        The level of nesting for this topic
      • setLevel

        public void setLevel​(int level)
        Specified by:
        setLevel in interface Topic
      • getSubTopics

        public java.util.LinkedList<Topic> getSubTopics()
        Description copied from interface: Topic
        Get subtopics that are associated with this topic, or contained by this topic.
        Specified by:
        getSubTopics in interface Topic
        Returns:
        A list of topics
      • addSubTopics

        public void addSubTopics​(java.util.Collection<Topic> topics)
      • addSubTopic

        public void addSubTopic​(Topic topic)
        Description copied from interface: Topic
        Add a subtopic to this topic.
        Specified by:
        addSubTopic in interface Topic
        Parameters:
        topic - a ne subtopic
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setName

        public void setName​(java.lang.String name)