Jive Forums API (5.5.20.2-oracle) Developer Javadocs

com.jivesoftware.forum.nntp
Class ArticleFilter

java.lang.Object
  extended by com.jivesoftware.forum.nntp.ArticleFilter
Direct Known Subclasses:
ArticleHeaderFilter

public class ArticleFilter
extends java.lang.Object

Filters article lists according to those that match the range, message id, or patterns passed to the filter. Used with commands like XOVER, XHDR, etc. A range can be:


Field Summary
static int ALL
          The filter will match all articles.
static ArticleFilter ALL_ARTICLE_FILTER
          A simple constant filter for current article filtering.
static int CURRENT_ARTICLE
          The filter matches the current article pointer article.
static ArticleFilter CURRENT_ARTICLE_FILTER
          A simple constant filter for current article filtering.
static int MESSAGE_ID
          The filter will match one article by message id.
static int NUMBER
          The filter will match one article by message number.
static int OPEN_RANGE
          The filter will match articles with numbers greater than or equal to the start index number.
static int RANGE
          The filter will match articles between the start and end index numbers.
 
Constructor Summary
ArticleFilter(java.lang.String range)
          Create an article filter for the given article range.
 
Method Summary
 int getArticleNumber()
          Obtain the article number of the article this filter is looking for.
 int getEndIndex()
          Obtain the second filter number, specifying the message end index if the mode RANGE.
 java.lang.String getMessageID()
          Obtain the message ID of the article this filter is looking for.
 int getMode()
          Returns the filter mode currently set.
 int getStartIndex()
          Obtain the first filter number, specifying the message number if the mode is NUMBER, or the start index if the mode is OPEN_RANGE or RANGE.
 void setRange(java.lang.String range)
          Sets the filter mode (mutually exclusive) to the given article number or message id range.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALL

public static final int ALL

The filter will match all articles.

See Also:
Constant Field Values

CURRENT_ARTICLE

public static final int CURRENT_ARTICLE

The filter matches the current article pointer article.

See Also:
Constant Field Values

MESSAGE_ID

public static final int MESSAGE_ID

The filter will match one article by message id.

See Also:
Constant Field Values

NUMBER

public static final int NUMBER

The filter will match one article by message number.

See Also:
Constant Field Values

RANGE

public static final int RANGE

The filter will match articles between the start and end index numbers.

See Also:
Constant Field Values

OPEN_RANGE

public static final int OPEN_RANGE

The filter will match articles with numbers greater than or equal to the start index number.

See Also:
Constant Field Values

CURRENT_ARTICLE_FILTER

public static final ArticleFilter CURRENT_ARTICLE_FILTER

A simple constant filter for current article filtering.


ALL_ARTICLE_FILTER

public static final ArticleFilter ALL_ARTICLE_FILTER

A simple constant filter for current article filtering.

Constructor Detail

ArticleFilter

public ArticleFilter(java.lang.String range)

Create an article filter for the given article range.

Parameters:
range - the article range to apply to this filter.
Method Detail

getMode

public int getMode()

Returns the filter mode currently set.

Returns:
the current filter mode.

setRange

public void setRange(java.lang.String range)

Sets the filter mode (mutually exclusive) to the given article number or message id range.

Parameters:
range - the range (number, number-, number-number, <messageid>).

getMessageID

public java.lang.String getMessageID()
                              throws java.lang.IllegalStateException

Obtain the message ID of the article this filter is looking for. The returned string is only valid if the mode is equal to MESSAGE_ID.

Returns:
the message ID of the article to locate.
Throws:
java.lang.IllegalStateException - if the parameter is not relevant to the current filter mode..

getArticleNumber

public int getArticleNumber()
                     throws java.lang.IllegalStateException

Obtain the article number of the article this filter is looking for. The returned number is only valid if the mode is equal to NUMBER.

Returns:
the article number of the article to locate.
Throws:
java.lang.IllegalStateException - if the parameter is not relevant to the current filter mode.

getStartIndex

public int getStartIndex()
                  throws java.lang.IllegalStateException

Obtain the first filter number, specifying the message number if the mode is NUMBER, or the start index if the mode is OPEN_RANGE or RANGE.

Returns:
the first filter number indicating start index or number of articles that match this filter.
Throws:
java.lang.IllegalStateException - if the parameter is not relevant to the current filter mode.

getEndIndex

public int getEndIndex()
                throws java.lang.IllegalStateException

Obtain the second filter number, specifying the message end index if the mode RANGE.

Returns:
the second filter number indicating end index of aticles that match this filter.
Throws:
java.lang.IllegalStateException - if the parameter is not relevant to the current filter mode.

Jive Forums Project Page

Copyright © 1999-2006 Jive Software.