org.apache.geronimo.javamail.store.nntp.newsrc
Class NNTPNewsrcGroup

java.lang.Object
  extended by org.apache.geronimo.javamail.store.nntp.newsrc.NNTPNewsrcGroup

public class NNTPNewsrcGroup
extends Object


Field Summary
protected  String name
           
protected  RangeList ranges
           
protected  boolean subscribed
           
 
Constructor Summary
NNTPNewsrcGroup(NNTPNewsrc newsrc, String name, String newsrcRanges, boolean subscribed)
          Construct a .newsrc group item.
 
Method Summary
 String getName()
          Get the group name.
 boolean isArticleSeen(int article)
          Test if an article has been seen yet.
 boolean isSubscribed()
          Get the newsrc subscribed status for an article.
 void markArticleSeen(int article)
          Mark an article as seen.
 void markArticleUnseen(int article)
          Mark an article as unseen.
static NNTPNewsrcGroup parse(NNTPNewsrc newsrc, String line)
          Construct a NNTPNewsrcGroup item associated with a given .newsrc database.
 void save(Writer out)
          Save this group definition to a .newsrc file.
 void setSubscribed(boolean flag)
          Set the subscription status for an article.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected String name

subscribed

protected boolean subscribed

ranges

protected RangeList ranges
Constructor Detail

NNTPNewsrcGroup

public NNTPNewsrcGroup(NNTPNewsrc newsrc,
                       String name,
                       String newsrcRanges,
                       boolean subscribed)
Construct a .newsrc group item.

Parameters:
newsrc - The owning newsrc database.
name - The group name.
newsrcRanges - The initial set of seen ranges for the group (may be null).
subscribed - The initial group subscription state.
Method Detail

parse

public static NNTPNewsrcGroup parse(NNTPNewsrc newsrc,
                                    String line)
Construct a NNTPNewsrcGroup item associated with a given .newsrc database.

Parameters:
newsrc - The owning .newsrc database.
line - The .newsrc range entries in .newsrc format. These ranges are parsed to create a set of seen flags.
Returns:
A created NNTPNewsrcGroup item.

getName

public String getName()
Get the group name.

Returns:
The String name of the group.

isSubscribed

public boolean isSubscribed()
Get the newsrc subscribed status for an article.

Returns:
The current subscription flag.

setSubscribed

public void setSubscribed(boolean flag)
Set the subscription status for an article.

Parameters:
flag - The new subscription value.

isArticleSeen

public boolean isArticleSeen(int article)
Test if an article has been seen yet.

Parameters:
article - The target article.
Returns:
The seen mark for the article.

markArticleSeen

public void markArticleSeen(int article)
Mark an article as seen.

Parameters:
article - The target article number.

markArticleUnseen

public void markArticleUnseen(int article)
Mark an article as unseen.

Parameters:
article - The target article number.

save

public void save(Writer out)
          throws IOException
Save this group definition to a .newsrc file.

Parameters:
out - The output writer to send the information to.
Throws:
IOException


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.