Class JDomRatingTemplate

java.lang.Object
hec.data.rating.JDomRatingTemplate
All Implemented Interfaces:
IRatingTemplate, Comparable<IRatingTemplate>

public class JDomRatingTemplate extends Object implements IRatingTemplate, Comparable<IRatingTemplate>
Describes a Rating Template that has a set of independent parameters, a dependent parameter and a version. Eventually this stuff will support XML, but not right now hence the JDom prefix. Stage;Flow.USGS-shifted Count-Conduit_Gates,Opening-Conduit_Gates,Elev-Pool;Flow-Conduit_Gates.Normal IndepParameter1,IndepParameter2..n;DepParameter.Version
  • Field Details

    • parsingRegexp

      public final String parsingRegexp
      Regexp to parse the string version of the template.
      See Also:
    • validationRegexp

      public final String validationRegexp
      Regexp to validate the string version of the template.
      See Also:
    • parsingPattern

      public final Pattern parsingPattern
      Pattern used to parse the string version of the template.
    • validationPattern

      public final Pattern validationPattern
      Pattern used to validate the string version of the template.
  • Constructor Details

    • JDomRatingTemplate

      public JDomRatingTemplate()
      Constructs an empty invalid template object. Use the setters to populate this object.
    • JDomRatingTemplate

      public JDomRatingTemplate(DbOfficeId officeId, List<Parameter> independentParameterList, Parameter dependentParameter, Version version)
      Constructs a new template with the args required to be valid.
      Parameters:
      officeId -
      independentParameterList -
      dependentParameter -
      version -
    • JDomRatingTemplate

      public JDomRatingTemplate(IRatingTemplate template)
      Copy constructs this template from the arg template.
      Parameters:
      template -
    • JDomRatingTemplate

      public JDomRatingTemplate(String officeId, String templateId) throws DataSetException
      Creates a new template from the Strings. Will throw an exception if the arg Strings are not valid.
      Parameters:
      officeId -
      templateId -
      Throws:
      DataSetException
  • Method Details

    • hashCode

      public int hashCode()
      Returns a hashcode for this template.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Returns if this template is equal to the arg object.
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Returns the string version of this template. Stage;Flow.USGS-shifted Count-Conduit_Gates,Opening-Conduit_Gates,Elev-Pool ;Flow-Conduit_Gates.Normal
      Overrides:
      toString in class Object
      Returns:
    • getOfficeId

      public DbOfficeId getOfficeId()
      Returns the office id of this template.
      Specified by:
      getOfficeId in interface IRatingTemplate
      Returns:
    • setOfficeId

      public void setOfficeId(DbOfficeId officeId)
      Sets the office id of this template.
      Specified by:
      setOfficeId in interface IRatingTemplate
    • getDependentParameter

      public Parameter getDependentParameter()
      Returns the dependent parameter of this template.
      Specified by:
      getDependentParameter in interface IRatingTemplate
      Returns:
    • setDependentParameter

      public void setDependentParameter(Parameter dependentParameter)
      Sets the dependent parameter of this template.
      Specified by:
      setDependentParameter in interface IRatingTemplate
    • getIndependentParameterList

      public List<Parameter> getIndependentParameterList()
      Returns an ordered listing of the independent parameters for this template.
      Specified by:
      getIndependentParameterList in interface IRatingTemplate
      Returns:
    • setIndependentParameterList

      public void setIndependentParameterList(List<Parameter> independentParameterList)
      Sets the independent parmeters of this template to the ordered list.
      Specified by:
      setIndependentParameterList in interface IRatingTemplate
    • getTemplateVersion

      public Version getTemplateVersion()
      Returns the version of this template.
      Specified by:
      getTemplateVersion in interface IRatingTemplate
      Returns:
    • setTemplateVersion

      public void setTemplateVersion(Version version)
      Sets the version of this template.
      Specified by:
      setTemplateVersion in interface IRatingTemplate
    • compareTo

      public int compareTo(IRatingTemplate o)
      Compares this template to the arg template and returns an int describing order.
      Specified by:
      compareTo in interface Comparable<IRatingTemplate>
    • isSimple

      public boolean isSimple()
      Returns true if there is only one independent parameter in this template. I.e. The template could be used for a reverse rating.
      Specified by:
      isSimple in interface IRatingTemplate
      Returns:
    • getIndependentParameterCount

      public int getIndependentParameterCount()
      Returns a count of the independent parameters for this template.
      Specified by:
      getIndependentParameterCount in interface IRatingTemplate
      Returns: