org.apache.james.smtpserver.junkscore
Class ComposedJunkScore

java.lang.Object
  extended by org.apache.james.smtpserver.junkscore.ComposedJunkScore
All Implemented Interfaces:
JunkScore

public class ComposedJunkScore
extends java.lang.Object
implements JunkScore

Class to compose the two Junkscore Objects


Field Summary
 
Fields inherited from interface org.apache.james.smtpserver.junkscore.JunkScore
JUNK_SCORE, JUNK_SCORE_ATTR, JUNK_SCORE_COMPOSED_ATTR, JUNK_SCORE_SESSION, JUNK_SCORE_SESSION_ATTR
 
Constructor Summary
ComposedJunkScore(JunkScore score1, JunkScore score2)
          Construct Class
 
Method Summary
 double getCompleteStoredScores()
          Return the summary of stored scores
 double getStoredScore(java.lang.String key)
          Return the score for the given key.
 java.util.Map getStoredScores()
          Return a copy of the Map which contains the keys with the correspending scores
 double resetStoredScores()
          Reset the all stored scores in the map.
 double setStoredScore(java.lang.String key, double score)
          Throws an UnsuportedOperationException cause its not supported here
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComposedJunkScore

public ComposedJunkScore(JunkScore score1,
                         JunkScore score2)
                  throws java.lang.IllegalArgumentException
Construct Class

Parameters:
score1 - The JunkScore for the whole session
score2 - The JunkScore for the nail
Throws:
java.lang.IllegalArgumentException - get thrown if one of the given JunkScore Objects is null
Method Detail

getCompleteStoredScores

public double getCompleteStoredScores()
Description copied from interface: JunkScore
Return the summary of stored scores

Specified by:
getCompleteStoredScores in interface JunkScore
Returns:
score the summary of all stored scores
See Also:
JunkScore.getCompleteStoredScores()

getStoredScore

public double getStoredScore(java.lang.String key)
Description copied from interface: JunkScore
Return the score for the given key. Returns 0 if no score with the given key exist

Specified by:
getStoredScore in interface JunkScore
Parameters:
key - the key to get the score for
Returns:
score the score
See Also:
JunkScore.getStoredScore(java.lang.String)

getStoredScores

public java.util.Map getStoredScores()
Description copied from interface: JunkScore
Return a copy of the Map which contains the keys with the correspending scores

Specified by:
getStoredScores in interface JunkScore
Returns:
scoreMape the map which holds all keys and scores
See Also:
JunkScore.getStoredScores()

resetStoredScores

public double resetStoredScores()
Description copied from interface: JunkScore
Reset the all stored scores in the map. Return the summary of the previous stored scores.

Specified by:
resetStoredScores in interface JunkScore
Returns:
oldScore the summary of the old score;
See Also:
JunkScore.resetStoredScores()

setStoredScore

public double setStoredScore(java.lang.String key,
                             double score)
Throws an UnsuportedOperationException cause its not supported here

Specified by:
setStoredScore in interface JunkScore
Parameters:
key - the key under which the score should be stored
score - the store to score
Returns:
oldScore the previous scored stored under the given key
Throws:
java.lang.UnsupportedOperationException


Copyright ? 2002-2009 The Apache Software Foundation. All Rights Reserved.