chemaxon.descriptors
Class SDParameters

java.lang.Object
  extended by chemaxon.descriptors.MDParameters
      extended by chemaxon.descriptors.SDParameters
Direct Known Subclasses:
HBParameters, LDParameters

public class SDParameters
extends MDParameters

Manages ScalarDescriptor parameters. This class reads, stores and provides parameters for the ScalarDescriptor class. The native format of the parameter configuraton is XML.

Since:
JChem 2.2
Author:
Miklos Vargyas

Field Summary
 
Fields inherited from class chemaxon.descriptors.MDParameters
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, weights
 
Constructor Summary
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.
 
Method Summary
 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.
 
Methods inherited from class chemaxon.descriptors.MDParameters
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, 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SDParameters

public SDParameters()
Creates an empty object.


SDParameters

public SDParameters(java.io.File configFile)
             throws chemaxon.descriptors.MDParametersException
Creates a new object from the given configuration file.

Parameters:
configFile - XML configuration file
Throws:
chemaxon.descriptors.MDParametersException - missing or bad XML configuration

SDParameters

public SDParameters(java.lang.String XMLconfig)
             throws chemaxon.descriptors.MDParametersException
Creates a new object from the given configuration string.

Parameters:
XMLconfig - XML configuration string
Throws:
chemaxon.descriptors.MDParametersException - missing or bad XML configuration
Method Detail

fromString

public void fromString(java.lang.String parameterString)
                throws chemaxon.descriptors.MDParametersException
Sets parameters from a string representation. This method processes an XML format, but derived classes may overload this and define their own formats.

Overrides:
fromString in class MDParameters
Parameters:
parameterString - parameters in string
Throws:
chemaxon.descriptors.MDParametersException - when the parameter string is not well-formed

fromFile

public void fromFile(java.io.File parameterFile)
              throws chemaxon.descriptors.MDParametersException
Sets parameters from an XML file. Derived classes may overload this and define their own format (other than XML).

Overrides:
fromFile in class MDParameters
Parameters:
parameterFile - initialized parameter file
Throws:
chemaxon.descriptors.MDParametersException - failed to process parameter file

setLength

public void setLength(int length)
               throws chemaxon.descriptors.MDParametersException
Description copied from class: MDParameters
Sets the length (number of cells) of the descriptor.

Overrides:
setLength in class MDParameters
Parameters:
length - the required length (cell count)
Throws:
chemaxon.descriptors.MDParametersException - if argument is not positive

getNumberOfMetrics

public int getNumberOfMetrics()
Gets the total number of parametrized metrics available in the present configuration.

Overrides:
getNumberOfMetrics in class MDParameters
Returns:
number of metrics

init

protected void init()
This method is called by the constructors before processing the XML configuration. It creates a ScalarDescriptor object stored in MDParameters.md.


initParameters

protected void initParameters()
Initializes those data members that depend on the XML configuration but are not directly taken from it.

Overrides:
initParameters in class MDParameters

processDocument

protected void processDocument(boolean all)
                        throws chemaxon.descriptors.MDParametersException
Processes parts of the XML configuration specific to ScalarDescriptor. Find the node in the DOM tree and leaves the rest of the work to the parent class.

Overrides:
processDocument in class MDParameters
Parameters:
all - indicates if the entire document has to be processed in which case the existing configuration is overwritten
Throws:
chemaxon.descriptors.MDParametersException

getType

public java.lang.String getType()

readValues

protected void readValues(boolean all)
                   throws chemaxon.descriptors.MDParametersException
Reads attribute values form the XML configuration.

Overrides:
readValues in class MDParameters
Parameters:
all - process the complete document or only the ScreeningConfiguration tag
Throws:
chemaxon.descriptors.MDParametersException