org.jasen.core
Class MultiPointTestResult

java.lang.Object
  extended byorg.jasen.core.AbstractTestResult
      extended byorg.jasen.core.MultiPointTestResult
All Implemented Interfaces:
JasenTestResult, Serializable

public class MultiPointTestResult
extends AbstractTestResult

Returned from a test when the test is intended to contribute to a total number of spam "points".

Once all point based tests are run for a single message, the ultimate probability for these point tests is computed based on the points return and their corresponding weights

A point based test will accrue points during testing such that the higher the number of points scored, the greater the indication of spam.

The MultiPointTestResult differs from the standard PointTestResult in that it allows for multiple thresholds

Author:
Jason Polites
See Also:
ProbabilityTestResult, PointTestResult, Serialized Form

Constructor Summary
MultiPointTestResult(ProbabilityCalculator calculator)
          Constructs a new MultiPointTestResult
MultiPointTestResult(ProbabilityCalculator calculator, float defaultProbability)
          Constructs a new MultiPointTestResult
 
Method Summary
 void addPointResult(PointTestResult result)
          Adds a single point result to this multi point result
 float calculateProbability()
          Calculates the final probability for this test result based on the data contained within
 
Methods inherited from class org.jasen.core.AbstractTestResult
isAbsolute, setAbsolute
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiPointTestResult

public MultiPointTestResult(ProbabilityCalculator calculator)
Constructs a new MultiPointTestResult

Parameters:
calculator - The calculator to use when computing final results

MultiPointTestResult

public MultiPointTestResult(ProbabilityCalculator calculator,
                            float defaultProbability)
Constructs a new MultiPointTestResult

Parameters:
calculator - The calculator to use when computing final results
defaultProbability - The probability to use in the absence of further information
Method Detail

addPointResult

public void addPointResult(PointTestResult result)
Adds a single point result to this multi point result

Parameters:
result - A point result with it's value data already populated

calculateProbability

public float calculateProbability()
                           throws JasenException
Description copied from interface: JasenTestResult
Calculates the final probability for this test result based on the data contained within

Returns:
A probability such that the returned value is > 0.0 and < 1.0
Throws:
JasenException