Package hec.rss.model

Class OpValue

java.lang.Object
hec.rss.model.OpValue
All Implemented Interfaces:
AsciiSerializable, FieldAccessor, Serializable, Comparable

public class OpValue extends Object implements Comparable, AsciiSerializable
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

    Fields
    Modifier and Type
    Field
    Description
    optional hashtable holding release fractions keyed by child element number
    int
    constraint index releated to release
    float
    priority of the rule in the active zone
    int
    rule index releated to release
    int
    integer flag indicating rule type
    double
    value (flow) generated by the rule
  • Constructor Summary

    Constructors
    Constructor
    Description
    default constructor
    OpValue(double v)
    Constructor that initializes value only
    OpValue(int t, double v, float p)
    Constructor that initializes all data members
    Copy Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Implementation required by Comparable interface
    void
    changes the values of this OpValue by constriant in the given OpValue
    boolean
    Indicates whether some other object is "equal to" this one.
    This method allows access to java.lang.reflect.Field objects within the implementing class.
    void
    reinitialize to default values
    void
    init(int newType, double newValue)
    reinitialize to given values;
    void
    init(int t, double v, float p, int rid, int cid)
    reinitialize to the give values
    void
    init all fields to equal those of another OpValue
    boolean
    This allows access to fields withing the implementing object to set there data.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • type

      public int type
      integer flag indicating rule type
    • value

      public double value
      value (flow) generated by the rule
    • priority

      public float priority
      priority of the rule in the active zone
    • ruleid

      public int ruleid
      rule index releated to release
    • constraintid

      public int constraintid
      constraint index releated to release
    • childFractionTable

      public Hashtable 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 type
      v - value (flow) generated by the rule
      p - priority of the rule in the active zone
    • OpValue

      public OpValue(OpValue ov)
      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 type
      v - value (flow) generated by the rule
      p - priority of the rule in the active zone
      rid - the rule id
      cid - the constraint id
    • init

      public void init(OpValue ov)
      init all fields to equal those of another OpValue
      Parameters:
      ov - the OpValue to initialize to
    • constrainBy

      public void constrainBy(OpValue ov)
      changes the values of this OpValue by constriant in the given OpValue
      Parameters:
      ov - the OpValue to constrain by
    • equals

      public boolean equals(Object obj)
      Indicates whether some other object is "equal to" this one.
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the obj argument; false otherwise.
    • compareTo

      public int compareTo(Object o) throws ClassCastException
      Implementation required by Comparable interface
      Specified by:
      compareTo in interface Comparable
      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

      public String toString()
      Overrides:
      toString in class Object
    • getFieldObject

      public Object getFieldObject(Field fld)
      Description copied from interface: FieldAccessor
      This method allows access to java.lang.reflect.Field objects within the implementing class.
      Specified by:
      getFieldObject in interface FieldAccessor
      Parameters:
      fld - The field to get.
      Returns:
      The data object that is stored in the given field
    • setFieldObject

      public boolean setFieldObject(Field fld, Object fobj)
      Description copied from interface: FieldAccessor
      This allows access to fields withing the implementing object to set there data.
      Specified by:
      setFieldObject in interface FieldAccessor
      Parameters:
      fld - The java field object representing the member field to be set
      fobj - The data to set in that field
      Returns:
      returns true if successful