Package hec.rss.model

Class JunctionElement

All Implemented Interfaces:
AsciiSerializable, FieldAccessor, TSLocation, PlotVariableConstants, AltInputReportInfc, RssModelVariableConstants, RssReturnStatusConstants, RssTSLocation, hec.watershed.res.model.PlottableObject, Serializable, Cloneable, Comparable, Observer, rma.lang.Modifiable

public class JunctionElement extends Element implements AltInputReportInfc
See Also:
  • Field Details

    • _hasKnownOutflow

      protected boolean _hasKnownOutflow
    • _cpIndex

      protected int _cpIndex
  • Constructor Details

    • JunctionElement

      public JunctionElement()
    • JunctionElement

      public JunctionElement(RssSystem sys, int idx)
  • Method Details

    • setLabelPosition

      public void setLabelPosition(int p)
    • getLabelPosition

      public int getLabelPosition()
    • getFillColorName

      public String getFillColorName()
      gets the fill color name, null to use the default fill color
      Returns:
      the fill color name, null to use the default fill color
    • setFillColorName

      public void setFillColorName(String name)
      sets the fill color name, null to use the default fill color
      Parameters:
      name - the fill color name or null
    • toString

      public String toString()
      Returns the name of the Junction Element
      Overrides:
      toString in class Element
    • finalize

      public void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • isDownstreamControlLocation

      public boolean isDownstreamControlLocation()
    • isConfluence

      public boolean isConfluence()
      Tests if this junction element joins more than one upstream reach, has a diversion, or has more than one outflow.
      Returns:
      true if this is a confluence junction
    • getDiversions

      public Vector getDiversions(Vector divVec)
      returns a vector of diversion elements that use this junction as a source
    • getRequiredTSRecordProxies

      public Vector getRequiredTSRecordProxies()
      returns the flow TSRecordProxies from upstream nodes on this element
      Overrides:
      getRequiredTSRecordProxies in class Element
    • getConnectedElements

      public Vector getConnectedElements()
    • getComputationPointId

      public long getComputationPointId()
    • setComputationPoint

      public void setComputationPoint(hec.watershed.model.ComputationPoint cp)
      associates this element with a common computation point
    • hasRatingCurve

      public boolean hasRatingCurve()
      returns true if the Junction has rating curve data
    • getActiveStateVariables

      public List getActiveStateVariables(List svlist)
      adds all StateVariables refereced by diversion rule to the given List
      Overrides:
      getActiveStateVariables in class Element
    • getData

      public void getData(hec.rss.server.JunctionElementData jed)
    • setData

      public void setData(hec.rss.server.JunctionElementData jed)
    • setData

      public void setData(hec.rss.server.JunctionElementData jed, boolean setInfoData)
    • getStreamStation

      public double getStreamStation()
    • setStreamStation

      public boolean setStreamStation(StreamElement stream, double station)
    • resetStream

      public void resetStream()
    • getStream

      public StreamElement getStream()
    • getTribNameArray

      public String[] getTribNameArray()
    • getLocalFlowVector

      public Vector getLocalFlowVector()
      return a Vector of String arrays that contain the local flow information for this vector
      Returns:
      a non-null vector of String[] arrays. each array consists of:
      [0]=local flow name
      [1]=factor
      [2]=TSRecordProxy index
      [3]=node index
    • setLocalFlowVector

      public void setLocalFlowVector(Vector vect)
    • setCPIndex

      public void setCPIndex(int cpIndex)
      set Control Point Index (for compatibility with HEC5 type system)
    • getCPIndex

      public int getCPIndex()
    • readData

      public boolean readData(BufferedReader input)
      Description copied from class: Element
      Retrieves the Element data from the specified BufferedReader. This method is called by RssSystem.readFile after encountering an Element line type. Control of the file processing is passed back to the RssSystem object once an Element End line type is found or if "Element" is not contained in the line type. The later case is an error condition.

      The data stream must have type=param formatting. The following types and parameters are defined.

      Element Name= (String) name of the Element
      Element Nodes= (comma delimited ints) list of nodes connected by this element
      Element NodeDir= (comma delimited ints) list of node directions
      Element Function= (String) function type name
      Element End

      There must one NodeDir value for each RssNode associated with the element. A NodeDir value of 1 indicates positive flow at the node is an inflow to this element, 0 indicates a positive flow is an outflow.

      The function type name must be a valid Function Class name. The currently implemented classes include CoefRouting, Storage, Junction, Dam, and AdjustableFlow.
      The Element Function line type generate new Function according to the specified class name. The readData method of the new object is called to process class specific data. Control is returned to this method when a Element Function End line type is found. Note that a Element Function= line type must be matched by a Element Function End line type or the file will not be processed correctly.

      Overrides:
      readData in class Element
      Parameters:
      input - BufferedReader connected to the ASCII file containing the RssSystem data.
      See Also:
    • writeData

      public boolean writeData(BufferedWriter out)
      Overrides:
      writeData in class Element
    • addJunction

      public void addJunction(JunctionElement j)
      add nodes from given junction and then dispose of it
    • hasConnectedElements

      public boolean hasConnectedElements()
      determines whether junction is connected to any other elements
    • getModelVariables

      public Vector getModelVariables(Vector variableList)
      Specified by:
      getModelVariables in interface hec.watershed.res.model.PlottableObject
      Overrides:
      getModelVariables in class Element
    • getDefaultModelVariables

      public Vector getDefaultModelVariables()
      Returns a list of Model Variables that are used in the default plot required by PlottableObject interface
      Specified by:
      getDefaultModelVariables in interface hec.watershed.res.model.PlottableObject
      Overrides:
      getDefaultModelVariables in class Element
      Returns:
      list of ModelVariable objects
    • getTSRecords

      public Vector getTSRecords(ModelVariable plotVariable, Vector proxyList)
      Overrides:
      getTSRecords in class Element
    • importFrom

      public boolean importFrom(RuleResolution rr)
    • getLocalFlowTimeSeries

      public TSRecord getLocalFlowTimeSeries(String localFlowName)
      get the TimeSeries associated with the Local Flow localFlowName
      Parameters:
      localFlowName - the case sensitive name of the local flow
      Returns:
      the TimeSeries or null if there is no TimeSeries for the local flow name
    • getLocalFlowTimeSeries

      public List<TSRecord> getLocalFlowTimeSeries()
      get a List of TSRecords for all the local flow time series defined for this junction
      Returns:
      a non-null List of TSRecords
    • updateTSProxyList

      public void updateTSProxyList()
      Regenerates the list of all TSProxies required for this location. This list includes all records that are generated by this function even if the records are held in another objects (e.g. RssNode) proxy list
      Overrides:
      updateTSProxyList in class Element
    • 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 Element
      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 Element
      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
    • outputReport

      public void outputReport(AlternativeInputReport report, org.jdom.Element elem)
      Description copied from interface: AltInputReportInfc
      Alternative Input Report Interface for data.
      Specified by:
      outputReport in interface AltInputReportInfc
    • setStreamJunctionId

      public void setStreamJunctionId(int juncId)
      Parameters:
      index -
    • getStreamJunctionId

      public int getStreamJunctionId()