org.mycore.datamodel.ifs
Class MCRSimpleFCTDetector.MCRDetectionRule

java.lang.Object
  extended by 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
 
Constructor Summary
protected MCRSimpleFCTDetector.MCRDetectionRule(double score)
          Creates a new detection rule
 
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
 

Field Detail

score

protected double score
The score for matching this rule, a value between 0.0 and 1.0

Constructor Detail

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
Method Detail

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 of
header - the first bytes of the file content
Returns:
the score between 0.0 and 1.0 for matching this rule