@PublicAPI public class CDParameters extends MDParameters
CustomDescriptor
class.Modifier and Type | Field and Description |
---|---|
static int |
BINARY_DESCRIPTOR
descriptor type constants
|
protected int |
descrType
descriptor type
|
static int |
FLOAT_DESCRIPTOR |
static int |
INTEGER_DESCRIPTOR |
protected org.dom4j.Element |
parameters
|
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 |
---|
CDParameters()
Creates an empty object.
|
CDParameters(java.io.File configFile)
Creates a new descriptor configured from the given file.
|
CDParameters(int type)
Creates an empty object of the given type.
|
CDParameters(java.lang.String XMLconfig)
Creates a new object based on a 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.
|
java.lang.String |
getDefaultDocumentFrame()
Gets the XML configuration string.
|
int |
getDescrType()
Gets the type of the descriptor.
|
protected int |
getNumberOfWeights(int parametrizedMetricIndex)
Gets the number of weight factors used by the specified metric.
|
protected void |
init()
This method is called by the constructors before processing the XML
configuration.
|
protected void |
initGenerator()
This method is void in this class as custom descriptors are opaque, their
internal structure is not known.
|
protected void |
initParameters()
Initializes 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 that are specific to
CustomDescriptor . |
protected void |
readValues(boolean all)
Picks parameter values from the DOM tree.
|
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, getDefaultStandardizerConfiguration, getDescriptorTypeName, getInternalMetricIndex, getInternalSize, getLength, getMetricIndex, getMetricName, getMetricName, getNumberOfMetrics, 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 static final int BINARY_DESCRIPTOR
public static final int INTEGER_DESCRIPTOR
public static final int FLOAT_DESCRIPTOR
protected int descrType
protected org.dom4j.Element parameters
public CDParameters()
public CDParameters(int type)
public CDParameters(java.io.File configFile) throws MDParametersException
configFile
- XML configuration fileMDParametersException
- missing or bad XML configurationpublic CDParameters(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 positiveprotected void initGenerator() throws MDParametersException
MDParametersException
protected void init()
CustomDescriptor
object defined
in MDParameters.md
.
Metircs defined by the descirptor class are retrieved through this
object.protected void initParameters()
initParameters
in class MDParameters
public int getDescrType()
protected int getNumberOfWeights(int parametrizedMetricIndex) throws java.lang.IllegalArgumentException
getNumberOfWeights
in class MDParameters
parametrizedMetricIndex
- parametrized metric indexjava.lang.IllegalArgumentException
- if the given parameter is not a
valid metric indexpublic java.lang.String getDefaultDocumentFrame()
getDefaultDocumentFrame
in class MDParameters
protected void processDocument(boolean all) throws MDParametersException
CustomDescriptor
.
Find the processDocument
in class MDParameters
all
- indicates if the entire document has to be processed
in which case the existing configuration is overwrittenMDParametersException
protected void readValues(boolean all) throws MDParametersException
readValues
in class MDParameters
all
- indicates if the entire document has to be processed
in which case the existing configuration is overwrittenMDParametersException