Package hec.rss.model
Class TimeOfDayMultiplier
java.lang.Object
hec.rss.model.TimeOfDayMultiplier
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,AltInputReportInfc,Serializable,Cloneable
public class TimeOfDayMultiplier
extends Object
implements Serializable, Cloneable, AsciiSerializable, AltInputReportInfc
TimeOfDayMultiplier.java
This object consists of an array of doubles that act as a multiplier value for
interval of the day, or will compute a weighting factor for the hour of the day
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Clones this objectgetFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.doublegetHourlyMultiplier(int hour) Returns the multiplier for a given hour of the daydoublegetHourlyWeightedMultiplier(int hour) Returns the multiplier for a given hour of the day divided by the sum of all multipliers, and assuming interval value should be apportioned over the hour.intInterval time in hoursdoubledouble[]Returns the set of multipliersbooleanreturns true if all multipliers == 0booleanreturns true if all multipliers == 1static booleanisValidInterval(int interval) Test that the interval time ( in hours ) is validvoidoutputReport(AlternativeInputReport report, org.jdom.Element elem) Alternative Input Report Interface for data.booleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidsetInterval(int interval) Set interval ( in hours ) for multiplier databooleansetMultiplier(int idx, double val) Sets the multiplier for a given dayvoidsetMultipliers(double[] multiplier) Sets the multipliersdoubleSum all the weights
-
Constructor Details
-
TimeOfDayMultiplier
public TimeOfDayMultiplier()
-
-
Method Details
-
isDefaults
public boolean isDefaults()returns true if all multipliers == 1 -
isAllZeroes
public boolean isAllZeroes()returns true if all multipliers == 0 -
getLargestHourlyMultiplier
public double getLargestHourlyMultiplier() -
getHourlyMultiplier
public double getHourlyMultiplier(int hour) Returns the multiplier for a given hour of the day -
getHourlyWeightedMultiplier
public double getHourlyWeightedMultiplier(int hour) Returns the multiplier for a given hour of the day divided by the sum of all multipliers, and assuming interval value should be apportioned over the hour. The idea is for all the weighed multipliers to sum to 1.0 -
sumHourly
public double sumHourly()Sum all the weights -
getMultipliers
public double[] getMultipliers()Returns the set of multipliers -
setMultipliers
public void setMultipliers(double[] multiplier) Sets the multipliers -
setMultiplier
public boolean setMultiplier(int idx, double val) Sets the multiplier for a given day -
isValidInterval
public static boolean isValidInterval(int interval) Test that the interval time ( in hours ) is valid -
setInterval
public void setInterval(int interval) Set interval ( in hours ) for multiplier data -
getInterval
public int getInterval()Interval time in hours -
clone
Clones this object- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Parameters:
fld- The java field object representing the member field to be setfobj- The data to set in that field- Returns:
- returns true if successful
-
outputReport
Description copied from interface:AltInputReportInfcAlternative Input Report Interface for data.- Specified by:
outputReportin interfaceAltInputReportInfc
-