org.jasen.core
Class StandardScanResult

java.lang.Object
  extended byorg.jasen.core.StandardScanResult
All Implemented Interfaces:
JasenScanResult, Serializable

public class StandardScanResult
extends Object
implements JasenScanResult

Captures the information relating to the results of a scan. Namely the probability that the message is a spam email

Author:
Jason Polites
See Also:
Serialized Form

Constructor Summary
StandardScanResult()
           
 
Method Summary
 boolean completed()
          Returns false if the scan could not be completed due to an error
 String getExtractedText()
          Gets the plain text extracted from the HTML after it was parsed
 double getProbability()
          Returns the probability that the scanned message was a spam message
 String[][] getTestResults()
          Gets the results of each test
NOTE: This is a convenience method only intended to help debugging etc
 boolean isParseError()
          Tells us if there was an error whilst parsing the message
 void setExtractedText(String extractedText)
          Sets the plain text extracted from the HTML after it was parsed
 void setParseError(boolean parseError)
          Flags the message as having a parse error during parsing
 void setProbability(double probability)
          Sets the probability value to return from this result
 void setTestResults(String[][] testResults)
          Sets the list of test results for debugging
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardScanResult

public StandardScanResult()
Method Detail

getProbability

public double getProbability()
Description copied from interface: JasenScanResult
Returns the probability that the scanned message was a spam message

Specified by:
getProbability in interface JasenScanResult
Returns:
A probability between 0.0 and 1.0

setProbability

public void setProbability(double probability)
Sets the probability value to return from this result

Parameters:
probability - A value between 0.0 and 1.0

getExtractedText

public String getExtractedText()
Gets the plain text extracted from the HTML after it was parsed

Returns:
The plain text as a String

setExtractedText

public void setExtractedText(String extractedText)
Sets the plain text extracted from the HTML after it was parsed

Parameters:
extractedText - The plain text as a String

getTestResults

public String[][] getTestResults()
Description copied from interface: JasenScanResult
Gets the results of each test
NOTE: This is a convenience method only intended to help debugging etc

Specified by:
getTestResults in interface JasenScanResult
Returns:
A String array comprising of 4 values
See Also:
Jasen.RESULT_INDEX_PROBABILITY, Jasen.RESULT_INDEX_TIME, Jasen.RESULT_INDEX_NAME, Jasen.RESULT_INDEX_DISPLAY

setTestResults

public void setTestResults(String[][] testResults)
Sets the list of test results for debugging

Parameters:
testResults - The testResults to set.

isParseError

public boolean isParseError()
Tells us if there was an error whilst parsing the message

Returns:
true if the message could not be parsed, false otherwise

setParseError

public void setParseError(boolean parseError)
Flags the message as having a parse error during parsing

Parameters:
parseError - true if the message could not be parsed, false otherwise

completed

public boolean completed()
Description copied from interface: JasenScanResult
Returns false if the scan could not be completed due to an error

Specified by:
completed in interface JasenScanResult
Returns:
True if the scan completed successfully. False otherwise