org.mycore.datamodel.ifs
Class MCRSimpleFCTDetector.MCRDetectionRule
java.lang.Object
org.mycore.datamodel.ifs.MCRSimpleFCTDetector.MCRDetectionRule
- Direct Known Subclasses:
- MCRSimpleFCTDetector.MCRDoctypeRule, MCRSimpleFCTDetector.MCRExtensionRule, MCRSimpleFCTDetector.MCRPatternRule, MCRSimpleFCTDetector.MCRStringRule
- Enclosing class:
- MCRSimpleFCTDetector
abstract class MCRSimpleFCTDetector.MCRDetectionRule
- extends Object
Common superclass of different kinds of detection rules
|
Field Summary |
protected double |
score
The score for matching this rule, a value between 0.0 and 1.0 |
|
Method Summary |
(package private) abstract double |
getScore(String filename,
byte[] header)
Returns the score if filename and/or header matches this rule, or 0.0 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
score
protected double score
- The score for matching this rule, a value between 0.0 and 1.0
MCRSimpleFCTDetector.MCRDetectionRule
protected MCRSimpleFCTDetector.MCRDetectionRule(double score)
- Creates a new detection rule
- Parameters:
score - The score for matching this rule, a value between 0.0 and
1.0
getScore
abstract double getScore(String filename,
byte[] header)
- Returns the score if filename and/or header matches this rule, or 0.0
- Parameters:
filename - the name of the file to detect the content type ofheader - the first bytes of the file content
- Returns:
- the score between 0.0 and 1.0 for matching this rule