Package hec.model

Class StreamElement

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

public class StreamElement extends NamedType implements Serializable
Stream coodinate element.
See Also:
  • Constructor Details

    • StreamElement

      public StreamElement()
    • StreamElement

      public StreamElement(StreamAlignmentNodeIfc sys, int idx)
  • Method Details

    • reverseDirection

      public void reverseDirection()
      Method to reverse the upstream to downstream orientation of the stream element. The method reverses the order of points in the StreamPolyLine and reorients the node stream cordinates. Non-default stream stationing will remain intack, but default stream stationing will reverse direction. This may cause existing data sets that rely on the stream stationing to have problems, so use this method with care!!
    • getAlignment

      public StreamAlignmentIfc getAlignment()
    • setAlignment

      public void setAlignment(StreamAlignmentNodeIfc alignment)
    • getLine

      public WorldLine getLine()
    • getNodeVector

      public Vector getNodeVector()
    • getNodeVectorSorted

      public Vector getNodeVectorSorted()
    • getReferencePt

      public WorldPt getReferencePt()
    • setReferencePt

      public void setReferencePt(WorldPt pt)
    • setLine

      public void setLine(StreamPolyLine reg)
    • getLocationByCoord

      public WorldPt getLocationByCoord(double coord)
    • getCoordByLocation

      public double getCoordByLocation(WorldPt wpt)
    • getLocationByStation

      public WorldPt getLocationByStation(double station)
    • getStationByLocation

      public double getStationByLocation(WorldPt wpt)
      Given a location, find the nearest station.
    • getStationByCoord

      public double getStationByCoord(double coord)
      Given a stream coordinate, return a station based on stream node stations.
    • getCoordByStation

      public double getCoordByStation(double station)
      Given a stream station, return a stream coord based on stream node stations.
    • addNode

      public void addNode(StreamNode node)
    • deleteStreamNode

      public void deleteStreamNode(StreamNode node)
    • getUpstreamNode

      public StreamNode getUpstreamNode()
    • getDownstreamNode

      public StreamNode getDownstreamNode()
    • readData

      public boolean readData(BufferedReader input)
    • writeData

      public boolean writeData(BufferedWriter out)
    • getLineSegment

      public StreamPolyLine getLineSegment(double downStreamCoord, double upStreamCoord)
      return a line segment of this line
      Parameters:
      downStreamCoord - the down stream coordinate of the line segment
      upStreamCoord - the up stream coordinate of the line segment
      Returns:
      the line segment between downStreamCoord and upStreamCoord
    • resetNodeCoord

      public void resetNodeCoord()
    • getNameCoord

      public double getNameCoord()
      get the center of longest interval between nodes
    • setLinePoint

      public void setLinePoint(double coord, WorldPt wpt)
      reset the location of a point on the stream line
    • 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
    • loadId

      public boolean loadId()
    • locked

      public void locked(LockEvent event)
    • toString

      public String toString()
      Overrides:
      toString in class NamedType
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • setName

      public void setName(String name)
      Description copied from class: NamedType
      Set the NamedTypes's name to the argument String.
      Overrides:
      setName in class NamedType
    • isModified

      public boolean isModified()
      Description copied from class: NamedType
      Check if the object has been modified.
      Specified by:
      isModified in interface Modifiable
      Overrides:
      isModified in class NamedType
      Returns:
      true if the object has been modified