org.brains2b.coffee.message.filter
Class FilterNewsGroup

java.lang.Object
  extended by org.brains2b.coffee.message.filter.FilterNewsGroup
All Implemented Interfaces:
FilterTarget, NewsGroup, NNTPMessage

public class FilterNewsGroup
extends java.lang.Object
implements NewsGroup, FilterTarget

Implementation of NewsGroup that filters out any Article not matching the List of MessageFilter

This Filter does not change the underlying Article List

Version:
0.89.1 [Feb 26, 2008]
Author:
dennis@brains2b.nl

Constructor Summary
FilterNewsGroup(NewsGroup group, java.util.List filters)
           
 
Method Summary
 void addArticle(Article a)
           
 void addHeader(int id, java.lang.String s)
           
 void addLine(java.lang.String s)
           
 void endMessage()
           
 boolean equals(java.lang.Object obj)
           
 java.util.List getArticleList()
           
 int getEstimate()
           
 int getFilteredSize()
           
 int getFirst()
           
 java.lang.String getId()
           
 int getLast()
           
 java.util.Date getLastUpdated()
           
 java.lang.String getName()
           
 int getSize()
           
 int getType()
           
 boolean hasContent()
           
 int hashCode()
           
 boolean isAllowPost()
           
 boolean isHeaderSet()
           
 void removeArticle(Article a)
           
 void setAllowPost(boolean allowPost)
           
 void setArticleList(java.util.List articleList)
           
 void setEstimate(int estimate)
           
 void setFirst(int first)
           
 void setLast(int last)
           
 void setLastUpdated(java.util.Date lastUpdated)
           
 void setName(java.lang.String name)
           
 java.lang.String toString()
           
 void writeList(org.brains2b.saxo.SAXWriter sw)
           
 void writeMessage(org.brains2b.saxo.SAXWriter sw)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilterNewsGroup

public FilterNewsGroup(NewsGroup group,
                       java.util.List filters)
Method Detail

getArticleList

public java.util.List getArticleList()
Specified by:
getArticleList in interface NewsGroup

getFilteredSize

public int getFilteredSize()
Specified by:
getFilteredSize in interface FilterTarget

addArticle

public void addArticle(Article a)
Specified by:
addArticle in interface NewsGroup

addHeader

public void addHeader(int id,
                      java.lang.String s)
Specified by:
addHeader in interface NNTPMessage

addLine

public void addLine(java.lang.String s)
Specified by:
addLine in interface NNTPMessage

endMessage

public void endMessage()
Specified by:
endMessage in interface NNTPMessage

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getEstimate

public int getEstimate()
Specified by:
getEstimate in interface NewsGroup

getFirst

public int getFirst()
Specified by:
getFirst in interface NewsGroup

getId

public java.lang.String getId()
Specified by:
getId in interface NNTPMessage

getLast

public int getLast()
Specified by:
getLast in interface NewsGroup

getLastUpdated

public java.util.Date getLastUpdated()
Specified by:
getLastUpdated in interface NewsGroup

getName

public java.lang.String getName()
Specified by:
getName in interface NewsGroup

getSize

public int getSize()
Specified by:
getSize in interface NNTPMessage

getType

public int getType()
Specified by:
getType in interface NNTPMessage

hasContent

public boolean hasContent()
Specified by:
hasContent in interface NNTPMessage

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

isAllowPost

public boolean isAllowPost()
Specified by:
isAllowPost in interface NewsGroup

isHeaderSet

public boolean isHeaderSet()
Specified by:
isHeaderSet in interface NNTPMessage

removeArticle

public void removeArticle(Article a)
Specified by:
removeArticle in interface NewsGroup

setAllowPost

public void setAllowPost(boolean allowPost)
Specified by:
setAllowPost in interface NewsGroup

setArticleList

public void setArticleList(java.util.List articleList)
Specified by:
setArticleList in interface NewsGroup

setEstimate

public void setEstimate(int estimate)
Specified by:
setEstimate in interface NewsGroup

setFirst

public void setFirst(int first)
Specified by:
setFirst in interface NewsGroup

setLast

public void setLast(int last)
Specified by:
setLast in interface NewsGroup

setLastUpdated

public void setLastUpdated(java.util.Date lastUpdated)
Specified by:
setLastUpdated in interface NewsGroup

setName

public void setName(java.lang.String name)
Specified by:
setName in interface NewsGroup

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

writeMessage

public void writeMessage(org.brains2b.saxo.SAXWriter sw)
                  throws org.xml.sax.SAXException
Specified by:
writeMessage in interface NNTPMessage
Throws:
org.xml.sax.SAXException

writeList

public void writeList(org.brains2b.saxo.SAXWriter sw)
               throws org.xml.sax.SAXException
Specified by:
writeList in interface NewsGroup
Throws:
org.xml.sax.SAXException