Package org.apache.commons.net.nntp
Class Article
java.lang.Object
org.apache.commons.net.nntp.Article
- All Implemented Interfaces:
Threadable<Article>
Basic state needed for message retrieval and threading. With thanks to Jamie Zawinski (jwz@jwz.org)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHeaderField(String name, String val) Deprecated.voidaddReference(String msgId) Adds a message-id to the list of messages that this message references (i.e. replies to)Gets the article ID.intDeprecated.longGets the article number.getChild()Gets the child article.getDate()Gets the article date header.getFrom()Gets the article from header.getNext()Gets the next article.String[]Returns the MessageId references as an array of StringsGets the article subject.booleanisDummy()Tests whether this is a dummy instance.Creates a dummy instance.Gets an ID.String[]Gets reference strings.static voidprintThread(Article article) Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.static voidprintThread(Article article, int depth) Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.static voidprintThread(Article article, int depth, PrintStream ps) Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.static voidprintThread(Article article, PrintStream ps) Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.voidsetArticleId(String string) Sets the article ID.voidsetArticleNumber(int articleNumber) Deprecated.voidsetArticleNumber(long articleNumber) Sets the article number.voidSets the child instance.voidSets the article date header.voidSets the article from header.voidSets the next instance.voidsetSubject(String subject) Sets the article subject.Gets the simplified subject.booleanTests whether this is a reply.toString()
-
Field Details
-
kid
Deprecated.UsesetChild(Article)andgetChild().Will be private in 4.0. -
next
Deprecated.UsesetNext(Article)andgetNext().Will be private in 4.0.
-
-
Constructor Details
-
Article
public Article()Constructs a new instance.
-
-
Method Details
-
printThread
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
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
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 depthps- the PrintStream to use- Since:
- 3.4
-
printThread
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.Does nothing.- Parameters:
name- Ignored.val- Ignored.
-
addReference
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
Gets the article ID.- Returns:
- the article ID.
-
getArticleNumber
Deprecated.Gets the article number.- Returns:
- the article number.
-
getArticleNumberLong
Gets the article number.- Returns:
- the article number.
-
getChild
Gets the child article.- Returns:
- the child article.
- Since:
- 3.12.0
-
getDate
Gets the article date header.- Returns:
- the article date header.
-
getFrom
Gets the article from header.- Returns:
- the article from header.
-
getNext
Gets the next article.- Returns:
- the next article.
- Since:
- 3.12.0
-
getReferences
Returns the MessageId references as an array of Strings- Returns:
- an array of message-ids
-
getSubject
Gets the article subject.- Returns:
- the article subject.
-
isDummy
Description copied from interface:ThreadableTests whether this is a dummy instance.- Specified by:
isDummyin interfaceThreadable<Article>- Returns:
- whether this is a dummy instance.
-
makeDummy
Description copied from interface:ThreadableCreates a dummy instance.- Specified by:
makeDummyin interfaceThreadable<Article>- Returns:
- a dummy instance.
-
messageThreadId
Description copied from interface:ThreadableGets an ID.- Specified by:
messageThreadIdin interfaceThreadable<Article>- Returns:
- an ID.
-
messageThreadReferences
Description copied from interface:ThreadableGets reference strings.- Specified by:
messageThreadReferencesin interfaceThreadable<Article>- Returns:
- reference strings.
-
setArticleId
Sets the article ID.- Parameters:
string- the article ID.
-
setArticleNumber
Deprecated.Sets the article number.- Parameters:
articleNumber- the article number.
-
setArticleNumber
Sets the article number.- Parameters:
articleNumber- the article number.
-
setChild
Description copied from interface:ThreadableSets the child instance.- Specified by:
setChildin interfaceThreadable<Article>- Parameters:
child- the child instance.
-
setDate
Sets the article date header.- Parameters:
date- the article date header.
-
setFrom
Sets the article from header.- Parameters:
from- the article from header.
-
setNext
Description copied from interface:ThreadableSets the next instance.- Specified by:
setNextin interfaceThreadable<Article>- Parameters:
next- the next instance.
-
setSubject
Sets the article subject.- Parameters:
subject- the article subject.
-
simplifiedSubject
Description copied from interface:ThreadableGets the simplified subject.- Specified by:
simplifiedSubjectin interfaceThreadable<Article>- Returns:
- the simplified subject.
-
subjectIsReply
Description copied from interface:ThreadableTests whether this is a reply.- Specified by:
subjectIsReplyin interfaceThreadable<Article>- Returns:
- whether this is a reply.
-
toString
-
setChild(Article)andgetChild().