Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Private Attributes
MessageClassifier Class Reference
Inheritance diagram for MessageClassifier:
Inheritance graph
[legend]
Collaboration diagram for MessageClassifier:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 MessageClassifier (nsBayesianFilter *aFilter, nsIJunkMailClassificationListener *aListener, nsIMsgWindow *aMsgWindow, PRUint32 aNumMessagesToClassify, const char **aMessageURIs)
virtual ~MessageClassifier ()
virtual void analyzeTokens (Tokenizer &tokenizer)
virtual void classifyNextMessage ()
void setTokenListener (nsIStreamListener *aTokenListener)
void setSource (const char *sourceURI)

Public Attributes

nsCOMPtr< nsIStreamListenermTokenListener
nsCString mTokenSource

Private Attributes

nsBayesianFiltermFilter
nsCOMPtr< nsISupports > mSupports
nsCOMPtr
< nsIJunkMailClassificationListener
mListener
nsCOMPtr< nsIMsgWindowmMsgWindow
PRInt32 mNumMessagesToClassify
PRInt32 mCurMessageToClassify
char ** mMessageURIs

Detailed Description

Definition at line 987 of file nsBayesianFilter.cpp.


Constructor & Destructor Documentation

MessageClassifier::MessageClassifier ( nsBayesianFilter aFilter,
nsIJunkMailClassificationListener aListener,
nsIMsgWindow aMsgWindow,
PRUint32  aNumMessagesToClassify,
const char **  aMessageURIs 
) [inline]

Definition at line 989 of file nsBayesianFilter.cpp.

        :   mFilter(aFilter), mSupports(aFilter), mListener(aListener), mMsgWindow(aMsgWindow)
    {
      mCurMessageToClassify = 0;
      mNumMessagesToClassify = aNumMessagesToClassify;
      mMessageURIs = (char **) nsMemory::Alloc(sizeof(char *) * aNumMessagesToClassify);
      for (PRUint32 i = 0; i < aNumMessagesToClassify; i++)
        mMessageURIs[i] = PL_strdup(aMessageURIs[i]);

    }

Here is the call graph for this function:

virtual MessageClassifier::~MessageClassifier ( ) [inline, virtual]

Member Function Documentation

virtual void MessageClassifier::analyzeTokens ( Tokenizer tokenizer) [inline, virtual]

Implements TokenAnalyzer.

Definition at line 1009 of file nsBayesianFilter.cpp.

Here is the call graph for this function:

virtual void MessageClassifier::classifyNextMessage ( ) [inline, virtual]

Definition at line 1016 of file nsBayesianFilter.cpp.

    {
      
      if (++mCurMessageToClassify < mNumMessagesToClassify && mMessageURIs[mCurMessageToClassify]) {
        PR_LOG(BayesianFilterLogModule, PR_LOG_ALWAYS, ("classifyNextMessage(%s)", mMessageURIs[mCurMessageToClassify]));
        mFilter->tokenizeMessage(mMessageURIs[mCurMessageToClassify], mMsgWindow, this);
      }
      else
      {
        mTokenListener = nsnull; // this breaks the circular ref that keeps this object alive
                                 // so we will be destroyed as a result.
      }
    }

Here is the call graph for this function:

Here is the caller graph for this function:

void TokenAnalyzer::setSource ( const char *  sourceURI) [inline, inherited]

Definition at line 697 of file nsBayesianFilter.cpp.

{mTokenSource = sourceURI;}

Here is the caller graph for this function:

void TokenAnalyzer::setTokenListener ( nsIStreamListener aTokenListener) [inline, inherited]

Definition at line 692 of file nsBayesianFilter.cpp.

    {
      mTokenListener = aTokenListener;
    }

Member Data Documentation

Definition at line 1036 of file nsBayesianFilter.cpp.

Definition at line 1031 of file nsBayesianFilter.cpp.

Definition at line 1033 of file nsBayesianFilter.cpp.

Definition at line 1037 of file nsBayesianFilter.cpp.

Definition at line 1034 of file nsBayesianFilter.cpp.

Definition at line 1035 of file nsBayesianFilter.cpp.

nsCOMPtr<nsISupports> MessageClassifier::mSupports [private]

Definition at line 1032 of file nsBayesianFilter.cpp.

Definition at line 699 of file nsBayesianFilter.cpp.

Definition at line 700 of file nsBayesianFilter.cpp.


The documentation for this class was generated from the following file: