Class Article

java.lang.Object
org.apache.commons.net.nntp.Article
All Implemented Interfaces:
Threadable<Article>

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

  • Constructor Details

    • Article

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

    • 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, 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, 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(String name, String val)
      Deprecated.
      Does nothing.
      Parameters:
      name - Ignored.
      val - Ignored.
    • addReference

      public void addReference(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 String getArticleId()
      Gets the article ID.
      Returns:
      the article ID.
    • 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 String getDate()
      Gets the article date header.
      Returns:
      the article date header.
    • getFrom

      public 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 String[] getReferences()
      Returns the MessageId references as an array of Strings
      Returns:
      an array of message-ids
    • getSubject

      public 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.
    • makeDummy

      public Article makeDummy()
      Description copied from interface: Threadable
      Creates a dummy instance.
      Specified by:
      makeDummy in interface Threadable<Article>
      Returns:
      a dummy instance.
    • messageThreadId

      Description copied from interface: Threadable
      Gets an ID.
      Specified by:
      messageThreadId in interface Threadable<Article>
      Returns:
      an ID.
    • messageThreadReferences

      Description copied from interface: Threadable
      Gets reference strings.
      Specified by:
      messageThreadReferences in interface Threadable<Article>
      Returns:
      reference strings.
    • setArticleId

      public void setArticleId(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.
    • setChild

      public void setChild(Article child)
      Description copied from interface: Threadable
      Sets the child instance.
      Specified by:
      setChild in interface Threadable<Article>
      Parameters:
      child - the child instance.
    • setDate

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

      public void setFrom(String from)
      Sets the article from header.
      Parameters:
      from - the article from header.
    • setNext

      public void setNext(Article next)
      Description copied from interface: Threadable
      Sets the next instance.
      Specified by:
      setNext in interface Threadable<Article>
      Parameters:
      next - the next instance.
    • setSubject

      public void setSubject(String subject)
      Sets the article subject.
      Parameters:
      subject - the article subject.
    • simplifiedSubject

      Description copied from interface: Threadable
      Gets the simplified subject.
      Specified by:
      simplifiedSubject in interface Threadable<Article>
      Returns:
      the simplified subject.
    • subjectIsReply

      public boolean subjectIsReply()
      Description copied from interface: Threadable
      Tests whether this is a reply.
      Specified by:
      subjectIsReply in interface Threadable<Article>
      Returns:
      whether this is a reply.
    • toString

      public String toString()
      Overrides:
      toString in class Object