Package hec.data.rating
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 Summary
FieldsModifier and TypeFieldDescriptionfinal PatternPattern used to parse the string version of the template.final StringRegexp to parse the string version of the template.final PatternPattern used to validate the string version of the template.final StringRegexp to validate the string version of the template.Fields inherited from interface hec.data.rating.IRatingTemplate
INDEP_DEP_DELIM, INDEP_PARAM_DELIM, PART_DELIM -
Constructor Summary
ConstructorsConstructorDescriptionConstructs an empty invalid template object.JDomRatingTemplate(DbOfficeId officeId, List<Parameter> independentParameterList, Parameter dependentParameter, Version version) Constructs a new template with the args required to be valid.JDomRatingTemplate(IRatingTemplate template) Copy constructs this template from the arg template.JDomRatingTemplate(String officeId, String templateId) Creates a new template from the Strings. -
Method Summary
Modifier and TypeMethodDescriptionintCompares this template to the arg template and returns an int describing order.booleanReturns if this template is equal to the arg object.Returns the dependent parameter of this template.intReturns a count of the independent parameters for this template.Returns an ordered listing of the independent parameters for this template.Returns the office id of this template.Returns the version of this template.inthashCode()Returns a hashcode for this template.booleanisSimple()Returns true if there is only one independent parameter in this template.voidsetDependentParameter(Parameter dependentParameter) Sets the dependent parameter of this template.voidsetIndependentParameterList(List<Parameter> independentParameterList) Sets the independent parmeters of this template to the ordered list.voidsetOfficeId(DbOfficeId officeId) Sets the office id of this template.voidsetTemplateVersion(Version version) Sets the version of this template.toString()Returns the string version of this template.
-
Field Details
-
parsingRegexp
Regexp to parse the string version of the template.- See Also:
-
validationRegexp
Regexp to validate the string version of the template.- See Also:
-
parsingPattern
Pattern used to parse the string version of the template. -
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
Copy constructs this template from the arg template.- Parameters:
template-
-
JDomRatingTemplate
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. -
equals
Returns if this template is equal to the arg object. -
toString
Returns the string version of this template. Stage;Flow.USGS-shifted Count-Conduit_Gates,Opening-Conduit_Gates,Elev-Pool ;Flow-Conduit_Gates.Normal -
getOfficeId
Returns the office id of this template.- Specified by:
getOfficeIdin interfaceIRatingTemplate- Returns:
-
setOfficeId
Sets the office id of this template.- Specified by:
setOfficeIdin interfaceIRatingTemplate
-
getDependentParameter
Returns the dependent parameter of this template.- Specified by:
getDependentParameterin interfaceIRatingTemplate- Returns:
-
setDependentParameter
Sets the dependent parameter of this template.- Specified by:
setDependentParameterin interfaceIRatingTemplate
-
getIndependentParameterList
Returns an ordered listing of the independent parameters for this template.- Specified by:
getIndependentParameterListin interfaceIRatingTemplate- Returns:
-
setIndependentParameterList
Sets the independent parmeters of this template to the ordered list.- Specified by:
setIndependentParameterListin interfaceIRatingTemplate
-
getTemplateVersion
Returns the version of this template.- Specified by:
getTemplateVersionin interfaceIRatingTemplate- Returns:
-
setTemplateVersion
Sets the version of this template.- Specified by:
setTemplateVersionin interfaceIRatingTemplate
-
compareTo
Compares this template to the arg template and returns an int describing order.- Specified by:
compareToin interfaceComparable<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:
isSimplein interfaceIRatingTemplate- Returns:
-
getIndependentParameterCount
public int getIndependentParameterCount()Returns a count of the independent parameters for this template.- Specified by:
getIndependentParameterCountin interfaceIRatingTemplate- Returns:
-