Package hec.rss.model

Class OpSetRef

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable

public class OpSetRef extends NamedType implements Serializable, AsciiSerializable, Cloneable
OpSetRef is a container object that holds a reference to a Operations Set for a particular Reservoir. This class contains a transient reference to a Operations Set that is lost on serialization but is easily looked up again. It also contains a fixed ID number for the operations set it references.
See Also:
  • Field Details

    • _opSet

      protected transient OpSet _opSet
      The reference to the particular operation set
    • _opSetID

      protected int _opSetID
      the id/index of the operation set referneced by this object
    • _systemOpSet

      protected transient ResSystemOpSet _systemOpSet
      A reference ot the parent owner of this operation set
    • _reservoirIndex

      protected int _reservoirIndex
      The index of the reservoir that ownes this OpSet
  • Constructor Details

    • OpSetRef

      public OpSetRef()
    • OpSetRef

      public OpSetRef(ResSystemOpSet parent, int index, OpSet opSet)
      Constructor for the OpSetRef. Sets the parent (the class who ownes this class) and the reference to the Operation Set and the ReservoirElement it came from.
  • Method Details

    • getOpSetID

      public int getOpSetID()
      Returns the ID of the Reservoir Opration Set that this object references. Returns RMAConst.UNDEF_INT if there is no reference.
    • setParent

      public void setParent(ResSystemOpSet parent)
      Sets the parent owner of this object
    • getOpSet

      public OpSet getOpSet()
      Returns a reference to a Operation Set
    • getReserovirIndex

      public int getReserovirIndex()
      Returs the index of the reservoir element that ownes the Operation Set in this object
    • clone

      public Object clone() throws CloneNotSupportedException
      Returns a copy of this object. The Operations Set Id's are copied but a reference between the owner class (Parent) and the Operation Set are passed to the clone(); In other words the clone points to the same parent and Operation Set as this class
      Overrides:
      clone in class NamedType
      Throws:
      CloneNotSupportedException
    • 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
      Overrides:
      getFieldObject in class NamedType
      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
      Overrides:
      setFieldObject in class NamedType
      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