org.jasen.core
Class PointTestResult

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

public class PointTestResult
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.

A point based test may accrue any number of points such that the number of points is:

0 <= points <= Integer.MAX_VALUE

Author:
Jason Polites
See Also:
ProbabilityTestResult, Serialized Form

Constructor Summary
PointTestResult()
           
PointTestResult(float min, float max, int threshold)
          Constructs a new PointTestResult.
 
Method Summary
 void addPoint()
          Adds a point to the total number in the result.
 float calculateProbability()
          Calculates the final probability for this test result based on the data contained within
 float getMax()
          Gets the max probablity allowed.
 float getMin()
          Gets the min probablity allowed.
 int getPoints()
          Gets the number of points scored for the test form which this result was returned.
 int getThreshold()
          Gets the number of point observations which imply max probability.
 void setMax(float max)
          Sets the max probablity allowed.
 void setMin(float min)
          Sets the max probablity allowed.
 void setPoints(int points)
          Sets the number of points as a discrete value.
 void setThreshold(int threshold)
          Sets the number of point observations which imply max probability.
 
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

PointTestResult

public PointTestResult()

PointTestResult

public PointTestResult(float min,
                       float max,
                       int threshold)
Constructs a new PointTestResult.

Parameters:
min - The lowest possible probablity.
max - The highest possible probablity.
threshold - The threshold of points at which the max probability is returned.
Method Detail

getPoints

public int getPoints()
Gets the number of points scored for the test form which this result was returned.

Returns:

setPoints

public void setPoints(int points)
Sets the number of points as a discrete value. This value MUST be >= 0.

Parameters:
points -

addPoint

public void addPoint()
Adds a point to the total number in the result.


getMax

public float getMax()
Gets the max probablity allowed.

Returns:
Returns the max.

setMax

public void setMax(float max)
Sets the max probablity allowed.

Parameters:
max - The max to set.

getMin

public float getMin()
Gets the min probablity allowed.

Returns:
Returns the min.

setMin

public void setMin(float min)
Sets the max probablity allowed.

Parameters:
min - The min to set.

getThreshold

public int getThreshold()
Gets the number of point observations which imply max probability.

Returns:
Returns the threshold.

setThreshold

public void setThreshold(int threshold)
Sets the number of point observations which imply max probability.

Parameters:
threshold - The threshold to set.

calculateProbability

public float calculateProbability()
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