Class SDParameters

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

@PublicApi 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
  • Constructor Details

    • SDParameters

      public SDParameters()
      Creates an empty object.
    • SDParameters

      public SDParameters(File configFile) throws MDParametersException
      Creates a new object from the given configuration file.
      Parameters:
      configFile - XML configuration file
      Throws:
      MDParametersException - missing or bad XML configuration
    • SDParameters

      public SDParameters(String XMLconfig) throws MDParametersException
      Creates a new object from the given configuration string.
      Parameters:
      XMLconfig - XML configuration string
      Throws:
      MDParametersException - missing or bad XML configuration
  • Method Details

    • fromString

      public void fromString(String parameterString) throws 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:
      MDParametersException - when the parameter string is not well-formed
    • fromFile

      public void fromFile(File parameterFile) throws 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:
      MDParametersException - failed to process parameter file
    • setLength

      public void setLength(int length) throws 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:
      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 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:
      MDParametersException
    • getType

      public String getType()
    • readValues

      protected void readValues(boolean all) throws 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:
      MDParametersException