Class Article

  • All Implemented Interfaces:
    Threadable<Article>

    public class Article
    extends java.lang.Object
    implements Threadable<Article>
    Basic state needed for message retrieval and threading. With thanks to Jamie Zawinski (jwz@jwz.org)
    • Constructor Summary

      Constructors 
      Constructor Description
      Article()
      Constructs a new instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addHeaderField​(java.lang.String name, java.lang.String val)
      Deprecated.
      void addReference​(java.lang.String msgId)
      Adds a message-id to the list of messages that this message references (i.e.
      java.lang.String getArticleId()
      Gets the article ID.
      int getArticleNumber()
      Deprecated.
      long getArticleNumberLong()
      Gets the article number.
      Article getChild()
      Gets the child article.
      java.lang.String getDate()
      Gets the article date header.
      java.lang.String getFrom()
      Gets the article from header.
      Article getNext()
      Gets the next article.
      java.lang.String[] getReferences()
      Returns the MessageId references as an array of Strings
      java.lang.String getSubject()
      Gets the article subject.
      boolean isDummy()
      Tests whether this is a dummy instance.
      Article makeDummy()
      Creates a dummy instance.
      java.lang.String messageThreadId()
      Gets an ID.
      java.lang.String[] messageThreadReferences()
      Gets reference strings.
      static void printThread​(Article article)
      Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.
      static void printThread​(Article article, int depth)
      Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.
      static void printThread​(Article article, int depth, java.io.PrintStream ps)
      Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.
      static void printThread​(Article article, java.io.PrintStream ps)
      Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.
      void setArticleId​(java.lang.String string)
      Sets the article ID.
      void setArticleNumber​(int articleNumber)
      Deprecated.
      void setArticleNumber​(long articleNumber)
      Sets the article number.
      void setChild​(Article child)
      Sets the child instance.
      void setDate​(java.lang.String date)
      Sets the article date header.
      void setFrom​(java.lang.String from)
      Sets the article from header.
      void setNext​(Article next)
      Sets the next instance.
      void setSubject​(java.lang.String subject)
      Sets the article subject.
      java.lang.String simplifiedSubject()
      Gets the simplified subject.
      boolean subjectIsReply()
      Tests whether this is a reply.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Article

        public Article()
        Constructs a new instance.
    • Method Detail

      • printThread

        public static void printThread​(Article article)
        Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.
        Parameters:
        article - the root of the article 'tree'
        Since:
        3.4
      • printThread

        public static void printThread​(Article article,
                                       int depth)
        Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.
        Parameters:
        article - the root of the article 'tree'
        depth - the current tree depth
      • printThread

        public static void printThread​(Article article,
                                       int depth,
                                       java.io.PrintStream ps)
        Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.
        Parameters:
        article - the root of the article 'tree'
        depth - the current tree depth
        ps - the PrintStream to use
        Since:
        3.4
      • printThread

        public static void printThread​(Article article,
                                       java.io.PrintStream ps)
        Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.
        Parameters:
        article - the root of the article 'tree'
        ps - the PrintStream to use
        Since:
        3.4
      • addHeaderField

        @Deprecated
        public void addHeaderField​(java.lang.String name,
                                   java.lang.String val)
        Deprecated.
        Does nothing.
        Parameters:
        name - Ignored.
        val - Ignored.
      • addReference

        public void addReference​(java.lang.String msgId)
        Adds a message-id to the list of messages that this message references (i.e. replies to)
        Parameters:
        msgId - the message id to add
      • getArticleId

        public java.lang.String getArticleId()
        Gets the article ID.
        Returns:
        the article ID.
      • getArticleNumber

        @Deprecated
        public int getArticleNumber()
        Deprecated.
        Gets the article number.
        Returns:
        the article number.
      • getArticleNumberLong

        public long getArticleNumberLong()
        Gets the article number.
        Returns:
        the article number.
      • getChild

        public Article getChild()
        Gets the child article.
        Returns:
        the child article.
        Since:
        3.12.0
      • getDate

        public java.lang.String getDate()
        Gets the article date header.
        Returns:
        the article date header.
      • getFrom

        public java.lang.String getFrom()
        Gets the article from header.
        Returns:
        the article from header.
      • getNext

        public Article getNext()
        Gets the next article.
        Returns:
        the next article.
        Since:
        3.12.0
      • getReferences

        public java.lang.String[] getReferences()
        Returns the MessageId references as an array of Strings
        Returns:
        an array of message-ids
      • getSubject

        public java.lang.String getSubject()
        Gets the article subject.
        Returns:
        the article subject.
      • isDummy

        public boolean isDummy()
        Description copied from interface: Threadable
        Tests whether this is a dummy instance.
        Specified by:
        isDummy in interface Threadable<Article>
        Returns:
        whether this is a dummy instance.
      • setArticleId

        public void setArticleId​(java.lang.String string)
        Sets the article ID.
        Parameters:
        string - the article ID.
      • setArticleNumber

        @Deprecated
        public void setArticleNumber​(int articleNumber)
        Deprecated.
        Sets the article number.
        Parameters:
        articleNumber - the article number.
      • setArticleNumber

        public void setArticleNumber​(long articleNumber)
        Sets the article number.
        Parameters:
        articleNumber - the article number.
      • setDate

        public void setDate​(java.lang.String date)
        Sets the article date header.
        Parameters:
        date - the article date header.
      • setFrom

        public void setFrom​(java.lang.String from)
        Sets the article from header.
        Parameters:
        from - the article from header.
      • setSubject

        public void setSubject​(java.lang.String subject)
        Sets the article subject.
        Parameters:
        subject - the article subject.
      • toString

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