Package hec.data.rating
Class AbstractRatingInput
java.lang.Object
hec.data.rating.AbstractRatingInput
- Direct Known Subclasses:
RatingInput
,ReverseRatingInput
An abstract base class for rate fuction input. This class holds the metadata
describing what we are going to rate on. The value data is defined in
concrete sub-classes.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionEmpty constructor, use setters to fully populate after using this constructor.AbstractRatingInput
(IRatingSpecification spec, Date ratingTime, boolean roundDependent) Creates a new input with the required items to be valid. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkUnitAgainstParameter
(String unit, Parameter parameter, String paramType) Verifies that the unit is equal to or can be converted to parameter units.Returns the unit that dependent values should be returned as.Returns the rating specification.Returns the rating time, i.e.boolean
Determines if dependent values are rounded.void
setDependentUnit
(String unit) Sets the unit that dependent values should be returned as.void
Sets the rating specification to rate on.void
setRatingTime
(Date ratingTime) Sets the rating time i.e.void
setRoundOutput
(boolean tf) Determines if the dependent output will be rounded.abstract void
validate()
Checks if this input data object is valid, will throw an exception if not valid.
-
Field Details
-
EFFECTIVE_DATE
A constant for the effective date of the rating.- See Also:
-
CREATE_DATE
A constant for when this rating was created.- See Also:
-
-
Constructor Details
-
AbstractRatingInput
public AbstractRatingInput()Empty constructor, use setters to fully populate after using this constructor. -
AbstractRatingInput
Creates a new input with the required items to be valid.- Parameters:
spec
-ratingTime
-roundDependent
-
-
-
Method Details
-
validate
Checks if this input data object is valid, will throw an exception if not valid.- Throws:
DataSetException
-
checkUnitAgainstParameter
protected void checkUnitAgainstParameter(String unit, Parameter parameter, String paramType) throws DataSetException Verifies that the unit is equal to or can be converted to parameter units. Will throw an exception if not.- Parameters:
unit
-parameter
-paramType
-- Throws:
DataSetException
-
getRatingSpecification
Returns the rating specification.- Returns:
-
getRatingTime
Returns the rating time, i.e. the rating creation date to use for the rate function call.- Returns:
-
getRoundOutput
public boolean getRoundOutput()Determines if dependent values are rounded.- Returns:
-
setRatingSpecification
Sets the rating specification to rate on.- Parameters:
spec
-
-
setRatingTime
Sets the rating time i.e. the rating creation date to use for rating. If null, the most current is used.- Parameters:
ratingTime
-
-
setRoundOutput
public void setRoundOutput(boolean tf) Determines if the dependent output will be rounded.- Parameters:
tf
-
-
getDependentUnit
Returns the unit that dependent values should be returned as.- Returns:
-
setDependentUnit
Sets the unit that dependent values should be returned as.- Parameters:
unit
-
-