org.apache.commons.net.nntp

Class Article

public class Article extends Object implements Threadable

This is a class that contains the basic state needed for message retrieval and threading. With thanks to Jamie Zawinski

Author: rwinston

Field Summary
Articlekid
Articlenext
Constructor Summary
Article()
Method Summary
voidaddHeaderField(String name, String val)
Adds an arbitrary header key and value to this message's header.
voidaddReference(String msgId)
Adds a message-id to the list of messages that this message references (i.e. replies to)
StringgetArticleId()
intgetArticleNumber()
StringgetDate()
StringgetFrom()
String[]getReferences()
Returns the MessageId references as an array of Strings
StringgetSubject()
booleanisDummy()
ThreadablemakeDummy()
StringmessageThreadId()
String[]messageThreadReferences()
static voidprintThread(Article article, int depth)
Recursive method that traverses a pre-threaded graph (or tree) of connected Article objects and prints them out.
voidsetArticleId(String string)
voidsetArticleNumber(int i)
voidsetChild(Threadable child)
voidsetDate(String string)
voidsetFrom(String string)
voidsetNext(Threadable next)
voidsetSubject(String string)
StringsimplifiedSubject()
booleansubjectIsReply()

Field Detail

kid

public Article kid

public Article next

Constructor Detail

Article

public Article()

Method Detail

addHeaderField

public void addHeaderField(String name, String val)
Adds an arbitrary header key and value to this message's header.

Parameters: name the header name val the header value

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

getArticleId

public String getArticleId()

getArticleNumber

public int getArticleNumber()

getDate

public String getDate()

getFrom

public String getFrom()

getReferences

public String[] getReferences()
Returns the MessageId references as an array of Strings

Returns: an array of message-ids

getSubject

public String getSubject()

isDummy

public boolean isDummy()

makeDummy

public Threadable makeDummy()

messageThreadId

public String messageThreadId()

messageThreadReferences

public String[] messageThreadReferences()

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

setArticleId

public void setArticleId(String string)

setArticleNumber

public void setArticleNumber(int i)

setChild

public void setChild(Threadable child)

setDate

public void setDate(String string)

setFrom

public void setFrom(String string)

setNext

public void setNext(Threadable next)

setSubject

public void setSubject(String string)

simplifiedSubject

public String simplifiedSubject()

subjectIsReply

public boolean subjectIsReply()