Package chemaxon.descriptors
Class CDParameters
java.lang.Object
chemaxon.descriptors.MDParameters
chemaxon.descriptors.CDParameters
Manages parameters the 
CustomDescriptor class.- Since:
- JChem 2.3
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final intdescriptor type constantsprotected intdescriptor typestatic final intstatic final intprotected org.dom4j.Elementnode in the DOM tree built from the XML configuration Fields inherited from class chemaxon.descriptors.MDParametersasymmetryFactors, 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 SummaryConstructorsConstructorDescriptionCreates an empty object.CDParameters(int type) Creates an empty object of the given type.CDParameters(File configFile) Creates a new descriptor configured from the given file.CDParameters(String XMLconfig) Creates a new object based on a given configuration string.
- 
Method SummaryModifier and TypeMethodDescriptionvoidSets parameters from an XML file.voidfromString(String parameterString) Sets parameters from a string representation.Gets the XML configuration string.intGets the type of the descriptor.protected intgetNumberOfWeights(int parametrizedMetricIndex) Gets the number of weight factors used by the specified metric.protected voidinit()This method is called by the constructors before processing the XML configuration.protected voidThis method is void in this class as custom descriptors are opaque, their internal structure is not known.protected voidInitializes data members that depend on the XML configuration but are not directly taken from it.protected voidprocessDocument(boolean all) Processes parts of the XML configuration that are specific toCustomDescriptor.protected voidreadValues(boolean all) Picks parameter values from the DOM tree.voidsetLength(int length) Sets the length (number of cells) of the descriptor.Methods inherited from class chemaxon.descriptors.MDParametersaddParameters, 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
- 
Field Details- 
BINARY_DESCRIPTORpublic static final int BINARY_DESCRIPTORdescriptor type constants- See Also:
 
- 
INTEGER_DESCRIPTORpublic static final int INTEGER_DESCRIPTOR- See Also:
 
- 
FLOAT_DESCRIPTORpublic static final int FLOAT_DESCRIPTOR- See Also:
 
- 
descrTypeprotected int descrTypedescriptor type
- 
parametersprotected org.dom4j.Element parametersnode in the DOM tree built from the XML configuration 
 
- 
- 
Constructor Details- 
CDParameterspublic CDParameters()Creates an empty object. The type of the descriptor is not yet determined.
- 
CDParameterspublic CDParameters(int type) Creates an empty object of the given type. Initializes to default values.
- 
CDParametersCreates a new descriptor configured from the given file.- Parameters:
- configFile- XML configuration file
- Throws:
- MDParametersException- missing or bad XML configuration
 
- 
CDParametersCreates a new object based on a given configuration string.- Parameters:
- XMLconfig- XML configuration string
- Throws:
- MDParametersException- missing or bad XML configuration
 
 
- 
- 
Method Details- 
fromStringSets parameters from a string representation. This method processes an XML format, but derived classes may overload this and define their own format.- Overrides:
- fromStringin class- MDParameters
- Parameters:
- parameterString- parameters in string
- Throws:
- MDParametersException- when the parameter string is not well-formed
 
- 
fromFileSets parameters from an XML file. Derived classes may overload this and define their own format (even other than XML).- Overrides:
- fromFilein class- MDParameters
- Parameters:
- parameterFile- initialized parameter file
- Throws:
- MDParametersException- failed to process parameter file
 
- 
setLengthDescription copied from class:MDParametersSets the length (number of cells) of the descriptor.- Overrides:
- setLengthin class- MDParameters
- Parameters:
- length- the required length (cell count)
- Throws:
- MDParametersException- if argument is not positive
 
- 
initGeneratorThis method is void in this class as custom descriptors are opaque, their internal structure is not known. Derived classes that implement user defined or 3rd party descriptors should overload this function and provide the procedure for descriptor generation.- Throws:
- MDParametersException
 
- 
initprotected void init()This method is called by the constructors before processing the XML configuration. It creates aCustomDescriptorobject defined inMDParameters.md. Metircs defined by the descirptor class are retrieved through this object.
- 
initParametersprotected void initParameters()Initializes data members that depend on the XML configuration but are not directly taken from it.- Overrides:
- initParametersin class- MDParameters
 
- 
getDescrTypepublic int getDescrType()Gets the type of the descriptor.- Returns:
- type of the descriptor (BINARY_DESCRIPTOR, INTEGER_DESCRIPTOR or FLOAT_DESCRIPTOR)
 
- 
getNumberOfWeightsGets the number of weight factors used by the specified metric. T- Overrides:
- getNumberOfWeightsin class- MDParameters
- Parameters:
- parametrizedMetricIndex- parametrized metric index
- Returns:
- number of weights the metric uses
- Throws:
- IllegalArgumentException- if the given parameter is not a valid metric index
 
- 
getDefaultDocumentFrameGets the XML configuration string. This is needed when the optional XML configuration is not specified.- Overrides:
- getDefaultDocumentFramein class- MDParameters
- Returns:
- default XML configuration string of the CDParameters class
 
- 
processDocumentProcesses parts of the XML configuration that are specific toCustomDescriptor. Find thenode in the DOM tree and leaves the rest of the work to the parent class. - Overrides:
- processDocumentin class- MDParameters
- Parameters:
- all- indicates if the entire document has to be processed in which case the existing configuration is overwritten
- Throws:
- MDParametersException
 
- 
readValuesPicks parameter values from the DOM tree.- Overrides:
- readValuesin class- MDParameters
- Parameters:
- all- indicates if the entire document has to be processed in which case the existing configuration is overwritten
- Throws:
- MDParametersException
 
 
-