Package hec.model
Class StreamElement
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.model.StreamElement
- All Implemented Interfaces:
hec.io.AsciiSerializable,Serializable,Cloneable,Comparable,Observer,Modifiable
Stream coodinate element.
- See Also:
-
Field Summary
Fields inherited from class hec.lang.NamedType
_description, _ignoreModifiedEvents, _index, _isValid, _modified, _name, defaultDescription, defaultName, DESCRIPTION_CHANGED, NAME_CHANGED, RENAME_EVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNode(StreamNode node) voiddeleteStreamNode(StreamNode node) booleandoubledoublegetCoordByStation(double station) Given a stream station, return a stream coord based on stream node stations.getFieldObject(Field fld) getLine()getLineSegment(double downStreamCoord, double upStreamCoord) return a line segment of this linegetLocationByCoord(double coord) getLocationByStation(double station) doubleget the center of longest interval between nodescheck if the node list is unsorted and if so, sort it before returning itdoublegetStationByCoord(double coord) Given a stream coordinate, return a station based on stream node stations.doubleGiven a location, find the nearest station.booleanCheck if the object has been modified.booleanloadId()voidbooleanreadData(BufferedReader input) voidvoidMethod to reverse the upstream to downstream orientation of the stream element.voidsetAlignment(StreamAlignmentNodeIfc alignment) booleansetFieldObject(Field fld, Object fobj) voidsetLine(StreamPolyLine reg) voidsetLinePoint(double coord, WorldPt wpt) reset the location of a point on the stream linevoidSet the NamedTypes's name to the argument String.voidtoString()booleanwriteData(BufferedWriter out) Methods inherited from class hec.lang.NamedType
addModifiableListener, clone, compareTo, fireModifiedStateChanged, getDescription, getDisplayName, getIgnoreModifiedEvents, getIndex, getName, isValid, readResolve, removeModifiableListener, rename, set, setDescription, setIgnoreModifiedEvents, setIndex, setModified, setValid, update, useRecursiveModifiedTestMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
-
Constructor Details
-
StreamElement
public StreamElement() -
StreamElement
-
-
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
-
setAlignment
-
getLine
-
getNodeVector
-
getNodeVectorSorted
check if the node list is unsorted and if so, sort it before returning it- Returns:
- the sorted node list
-
getReferencePt
-
setReferencePt
-
setLine
-
getLocationByCoord
-
getCoordByLocation
-
getLocationByStation
-
getStationByLocation
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
-
deleteStreamNode
-
getUpstreamNode
-
getDownstreamNode
-
readData
-
writeData
-
getLineSegment
return a line segment of this line- Parameters:
downStreamCoord- the down stream coordinate of the line segmentupStreamCoord- 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
reset the location of a point on the stream line -
getFieldObject
- Specified by:
getFieldObjectin interfacehec.io.AsciiSerializable- Overrides:
getFieldObjectin classNamedType
-
setFieldObject
- Specified by:
setFieldObjectin interfacehec.io.AsciiSerializable- Overrides:
setFieldObjectin classNamedType
-
loadId
public boolean loadId() -
locked
-
toString
-
equals
-
setName
Description copied from class:NamedTypeSet the NamedTypes's name to the argument String. -
isModified
public boolean isModified()Description copied from class:NamedTypeCheck if the object has been modified.- Specified by:
isModifiedin interfaceModifiable- Overrides:
isModifiedin classNamedType- Returns:
- true if the object has been modified
-