Class AbstractRatingInput

java.lang.Object
hec.data.rating.AbstractRatingInput
Direct Known Subclasses:
RatingInput, ReverseRatingInput

public abstract class AbstractRatingInput extends Object
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 Details

    • EFFECTIVE_DATE

      public static final String EFFECTIVE_DATE
      A constant for the effective date of the rating.
      See Also:
    • CREATE_DATE

      public static final String 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

      public AbstractRatingInput(IRatingSpecification spec, Date ratingTime, boolean roundDependent)
      Creates a new input with the required items to be valid.
      Parameters:
      spec -
      ratingTime -
      roundDependent -
  • Method Details

    • validate

      public abstract void validate() throws DataSetException
      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

      public IRatingSpecification getRatingSpecification()
      Returns the rating specification.
      Returns:
    • getRatingTime

      public Date 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

      public void setRatingSpecification(IRatingSpecification spec)
      Sets the rating specification to rate on.
      Parameters:
      spec -
    • setRatingTime

      public void setRatingTime(Date ratingTime)
      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

      public String getDependentUnit()
      Returns the unit that dependent values should be returned as.
      Returns:
    • setDependentUnit

      public void setDependentUnit(String unit)
      Sets the unit that dependent values should be returned as.
      Parameters:
      unit -