org.mycore.datamodel.ifs
Class MCRSimpleFCTDetector.MCRStringRule
java.lang.Object
org.mycore.datamodel.ifs.MCRSimpleFCTDetector.MCRDetectionRule
org.mycore.datamodel.ifs.MCRSimpleFCTDetector.MCRStringRule
- Enclosing class:
- MCRSimpleFCTDetector
class MCRSimpleFCTDetector.MCRStringRule
- extends MCRSimpleFCTDetector.MCRDetectionRule
A rule that decides based on a String at any position in the head of the file
|
Method Summary |
(package private) 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 |
string
protected String string
MCRSimpleFCTDetector.MCRStringRule
MCRSimpleFCTDetector.MCRStringRule(String string,
double score)
- Creates a new rule based on a match of a String at any position in the head of the file
- Parameters:
string - the string in the head of the file must matchscore - the score for matching this rule, a value between 0.0 and
1.0
getScore
double getScore(String filename,
byte[] header)
- Description copied from class:
MCRSimpleFCTDetector.MCRDetectionRule
- Returns the score if filename and/or header matches this rule, or 0.0
- Specified by:
getScore in class MCRSimpleFCTDetector.MCRDetectionRule
- 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