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 Pattern
Pattern used to parse the string version of the template.final String
Regexp to parse the string version of the template.final Pattern
Pattern used to validate the string version of the template.final String
Regexp 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 TypeMethodDescriptionint
Compares this template to the arg template and returns an int describing order.boolean
Returns if this template is equal to the arg object.Returns the dependent parameter of this template.int
Returns 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.int
hashCode()
Returns a hashcode for this template.boolean
isSimple()
Returns true if there is only one independent parameter in this template.void
setDependentParameter
(Parameter dependentParameter) Sets the dependent parameter of this template.void
setIndependentParameterList
(List<Parameter> independentParameterList) Sets the independent parmeters of this template to the ordered list.void
setOfficeId
(DbOfficeId officeId) Sets the office id of this template.void
setTemplateVersion
(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:
getOfficeId
in interfaceIRatingTemplate
- Returns:
-
setOfficeId
Sets the office id of this template.- Specified by:
setOfficeId
in interfaceIRatingTemplate
-
getDependentParameter
Returns the dependent parameter of this template.- Specified by:
getDependentParameter
in interfaceIRatingTemplate
- Returns:
-
setDependentParameter
Sets the dependent parameter of this template.- Specified by:
setDependentParameter
in interfaceIRatingTemplate
-
getIndependentParameterList
Returns an ordered listing of the independent parameters for this template.- Specified by:
getIndependentParameterList
in interfaceIRatingTemplate
- Returns:
-
setIndependentParameterList
Sets the independent parmeters of this template to the ordered list.- Specified by:
setIndependentParameterList
in interfaceIRatingTemplate
-
getTemplateVersion
Returns the version of this template.- Specified by:
getTemplateVersion
in interfaceIRatingTemplate
- Returns:
-
setTemplateVersion
Sets the version of this template.- Specified by:
setTemplateVersion
in interfaceIRatingTemplate
-
compareTo
Compares this template to the arg template and returns an int describing order.- Specified by:
compareTo
in 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:
isSimple
in interfaceIRatingTemplate
- Returns:
-
getIndependentParameterCount
public int getIndependentParameterCount()Returns a count of the independent parameters for this template.- Specified by:
getIndependentParameterCount
in interfaceIRatingTemplate
- Returns:
-