@PublicAPI public class SDParameters extends MDParameters
ScalarDescriptor
parameters. This class reads, stores
and provides parameters for the ScalarDescriptor
class. The
native format of the parameter configuraton is XML.asymmetryFactors, cellSize, cellwiseWeights, configFilePath, currentMetricIndex, data, decForm, DEFAULT_ASYMMETRY_FACTOR, DEFAULT_OUTPUT_PRECISION, DEFAULT_SCALE_FACTOR, DEFAULT_WEIGHT, defaultWeight, document, generator, internalSize, length, md, metricIndexes, normalized, outputPrecision, parametrizedMetricNodes, parametrizedMetrics, parametrizedMetricsNode, scaleFactors, screeningConfigurationNode, similarityNode, standardizer, standardizerConfigurationNode, thresholds, tverskyA, tverskyB, weights
Constructor and Description |
---|
SDParameters()
Creates an empty object.
|
SDParameters(java.io.File configFile)
Creates a new object from the given configuration file.
|
SDParameters(java.lang.String XMLconfig)
Creates a new object from the given configuration string.
|
Modifier and Type | Method and Description |
---|---|
void |
fromFile(java.io.File parameterFile)
Sets parameters from an XML file.
|
void |
fromString(java.lang.String parameterString)
Sets parameters from a string representation.
|
int |
getNumberOfMetrics()
Gets the total number of parametrized metrics available in the present
configuration.
|
java.lang.String |
getType() |
protected void |
init()
This method is called by the constructors before processing the XML
configuration.
|
protected void |
initParameters()
Initializes those data members that depend on the XML configuration but
are not directly taken from it.
|
protected void |
processDocument(boolean all)
Processes parts of the XML configuration specific to
ScalarDescriptor . |
protected void |
readValues(boolean all)
Reads attribute values form the XML configuration.
|
void |
setLength(int length)
Sets the length (number of cells) of the descriptor.
|
addParameters, addParameters, addParametrizedMetric, addParametrizedMetricNode, addParametrizedMetricsNode, appendParametrizedMetric, checkDocumentVersion, getAsymmetryFactor, getCellSize, getCurrentMetricIndex, getData, getDecForm, getDefaultDocumentFrame, getDefaultStandardizerConfiguration, getDescriptorTypeName, getInternalMetricIndex, getInternalSize, getLength, getMetricIndex, getMetricName, getMetricName, getNumberOfWeights, getNumberOfWeights, getScaleFactor, getScalingHypothesis, getScreeningConfigurationString, getThreshold, getThreshold, getTverskyAlpha, getTverskyBeta, getWeights, importNodes, isAsymmetric, isCellwiseWeights, isNormalized, isScaled, isStandardizationMandatory, isWeighted, readFromXmlFile, readFromXmlString, readMetricParameters, readMetricWeights, setAsymmetryFactor, setCellSize, setCellwiseWeights, setCreateStatistics, setCurrentParametrizedMetric, setNormalized, setOutputPrecision, setParameters, setParameters, setScaleFactor, setScalingHypothesis, setThreshold, setWeights, standardize, toString, toString, writeMetricParameter
public SDParameters()
public SDParameters(java.io.File configFile) throws MDParametersException
configFile
- XML configuration fileMDParametersException
- missing or bad XML configurationpublic SDParameters(java.lang.String XMLconfig) throws MDParametersException
XMLconfig
- XML configuration stringMDParametersException
- missing or bad XML configurationpublic void fromString(java.lang.String parameterString) throws MDParametersException
fromString
in class MDParameters
parameterString
- parameters in stringMDParametersException
- when the parameter string is not well-formedpublic void fromFile(java.io.File parameterFile) throws MDParametersException
fromFile
in class MDParameters
parameterFile
- initialized parameter fileMDParametersException
- failed to process parameter filepublic void setLength(int length) throws MDParametersException
MDParameters
setLength
in class MDParameters
length
- the required length (cell count)MDParametersException
- if argument is not positivepublic int getNumberOfMetrics()
getNumberOfMetrics
in class MDParameters
protected void init()
ScalarDescriptor
object stored
in MDParameters.md
.protected void initParameters()
initParameters
in class MDParameters
protected void processDocument(boolean all) throws MDParametersException
ScalarDescriptor
.
Find the processDocument
in class MDParameters
all
- indicates if the entire document has to be processed
in which case the existing configuration is overwrittenMDParametersException
public java.lang.String getType()
protected void readValues(boolean all) throws MDParametersException
readValues
in class MDParameters
all
- process the complete document or only the
ScreeningConfiguration
tagMDParametersException