Package hec.rss.model
Class OpValue
java.lang.Object
hec.rss.model.OpValue
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,Serializable,Comparable
A simple class that holds a rule type (max, min, spec), rule value, and
rule priority. The OpValue objects are stored in the OpValueSet vector.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionoptional hashtable holding release fractions keyed by child element numberintconstraint index releated to releasefloatpriority of the rule in the active zoneintrule index releated to releaseintinteger flag indicating rule typedoublevalue (flow) generated by the rule -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintImplementation required by Comparable interfacevoidconstrainBy(OpValue ov) changes the values of this OpValue by constriant in the given OpValuebooleanIndicates whether some other object is "equal to" this one.getFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.voidinit()reinitialize to default valuesvoidinit(int newType, double newValue) reinitialize to given values;voidinit(int t, double v, float p, int rid, int cid) reinitialize to the give valuesvoidinit all fields to equal those of another OpValuebooleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.toString()
-
Field Details
-
type
public int typeinteger flag indicating rule type -
value
public double valuevalue (flow) generated by the rule -
priority
public float prioritypriority of the rule in the active zone -
ruleid
public int ruleidrule index releated to release -
constraintid
public int constraintidconstraint index releated to release -
childFractionTable
optional hashtable holding release fractions keyed by child element number
-
-
Constructor Details
-
OpValue
public OpValue()default constructor -
OpValue
public OpValue(double v) Constructor that initializes value only- Parameters:
v- initial value
-
OpValue
public OpValue(int t, double v, float p) Constructor that initializes all data members- Parameters:
t- integer flag indicating rule typev- value (flow) generated by the rulep- priority of the rule in the active zone
-
OpValue
Copy Constructor- Parameters:
ov- OpValue object that provides initialization data
-
-
Method Details
-
init
public void init()reinitialize to default values -
init
public void init(int newType, double newValue) reinitialize to given values;- Parameters:
newType- the new Rule Type (min, max, spec)newValue- the new value (i.e. flow)
-
init
public void init(int t, double v, float p, int rid, int cid) reinitialize to the give values- Parameters:
t- integer flag indicating rule typev- value (flow) generated by the rulep- priority of the rule in the active zonerid- the rule idcid- the constraint id
-
init
init all fields to equal those of another OpValue- Parameters:
ov- the OpValue to initialize to
-
constrainBy
changes the values of this OpValue by constriant in the given OpValue- Parameters:
ov- the OpValue to constrain by
-
equals
Indicates whether some other object is "equal to" this one. -
compareTo
Implementation required by Comparable interface- Specified by:
compareToin interfaceComparable- Parameters:
o- another ValueElement object- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException
-
toString
-
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
-