Package org.apache.commons.net.nntp
Class Article
- java.lang.Object
-
- org.apache.commons.net.nntp.Article
-
- All Implemented Interfaces:
Threadable
public class Article extends java.lang.Object implements Threadable
This is a class that contains the basic state needed for message retrieval and threading. With thanks to Jamie Zawinski (jwz@jwz.org)
-
-
Constructor Summary
Constructors Constructor Description Article()
-
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()
int
getArticleNumber()
Deprecated.long
getArticleNumberLong()
java.lang.String
getDate()
java.lang.String
getFrom()
java.lang.String[]
getReferences()
Returns the MessageId references as an array of Stringsjava.lang.String
getSubject()
boolean
isDummy()
Threadable
makeDummy()
java.lang.String
messageThreadId()
java.lang.String[]
messageThreadReferences()
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)
void
setArticleNumber(int a)
Deprecated.void
setArticleNumber(long l)
void
setChild(Threadable child)
void
setDate(java.lang.String string)
void
setFrom(java.lang.String string)
void
setNext(Threadable next)
void
setSubject(java.lang.String string)
java.lang.String
simplifiedSubject()
boolean
subjectIsReply()
java.lang.String
toString()
-
-
-
Method Detail
-
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
-
getReferences
public java.lang.String[] getReferences()
Returns the MessageId references as an array of Strings- Returns:
- an array of message-ids
-
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, 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
-
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 depthps
- the PrintStream to use- Since:
- 3.4
-
getArticleId
public java.lang.String getArticleId()
-
getArticleNumberLong
public long getArticleNumberLong()
-
getDate
public java.lang.String getDate()
-
getFrom
public java.lang.String getFrom()
-
getSubject
public java.lang.String getSubject()
-
setArticleId
public void setArticleId(java.lang.String string)
-
setArticleNumber
public void setArticleNumber(long l)
-
setDate
public void setDate(java.lang.String string)
-
setFrom
public void setFrom(java.lang.String string)
-
setSubject
public void setSubject(java.lang.String string)
-
isDummy
public boolean isDummy()
- Specified by:
isDummy
in interfaceThreadable
-
messageThreadId
public java.lang.String messageThreadId()
- Specified by:
messageThreadId
in interfaceThreadable
-
messageThreadReferences
public java.lang.String[] messageThreadReferences()
- Specified by:
messageThreadReferences
in interfaceThreadable
-
simplifiedSubject
public java.lang.String simplifiedSubject()
- Specified by:
simplifiedSubject
in interfaceThreadable
-
subjectIsReply
public boolean subjectIsReply()
- Specified by:
subjectIsReply
in interfaceThreadable
-
setChild
public void setChild(Threadable child)
- Specified by:
setChild
in interfaceThreadable
-
setNext
public void setNext(Threadable next)
- Specified by:
setNext
in interfaceThreadable
-
makeDummy
public Threadable makeDummy()
- Specified by:
makeDummy
in interfaceThreadable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getArticleNumber
@Deprecated public int getArticleNumber()
Deprecated.
-
setArticleNumber
@Deprecated public void setArticleNumber(int a)
Deprecated.
-
addHeaderField
@Deprecated public void addHeaderField(java.lang.String name, java.lang.String val)
Deprecated.
-
-