Package hec.model
Class StreamElement
java.lang.Object
java.util.Observable
hec.lang.NamedType
hec.model.StreamElement
- All Implemented Interfaces:
AsciiSerializable,FieldAccessor,Serializable,Cloneable,Comparable,Observer,rma.lang.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) booleanhec.map.streamAlignment.StreamAlignmentIfcdoublegetCoordByLocation(hec.map.WorldPt wpt) doublegetCoordByStation(double station) Given a stream station, return a stream coord based on stream node stations.getFieldObject(Field fld) This method allows access to java.lang.reflect.Field objects within the implementing class.hec.map.WorldLinegetLine()getLineSegment(double downStreamCoord, double upStreamCoord) return a line segment of this linehec.map.WorldPtgetLocationByCoord(double coord) hec.map.WorldPtgetLocationByStation(double station) doubleget the center of longest interval between nodescheck if the node list is unsorted and if so, sort it before returning ithec.map.WorldPtdoublegetStationByCoord(double coord) Given a stream coordinate, return a station based on stream node stations.doublegetStationByLocation(hec.map.WorldPt wpt) Given a location, find the nearest station.booleanCheck if the object has been modified.booleanloadId()voidlocked(hec.event.LockEvent event) booleanreadData(BufferedReader input) voidvoidMethod to reverse the upstream to downstream orientation of the stream element.voidsetAlignment(hec.map.streamAlignment.StreamAlignmentNodeIfc alignment) booleansetFieldObject(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.voidsetLine(StreamPolyLine reg) voidsetLinePoint(double coord, hec.map.WorldPt wpt) reset the location of a point on the stream linevoidSet the NamedTypes's name to the argument String.voidsetReferencePt(hec.map.WorldPt pt) toString()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
public StreamElement(hec.map.streamAlignment.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 hec.map.streamAlignment.StreamAlignmentIfc getAlignment() -
setAlignment
public void setAlignment(hec.map.streamAlignment.StreamAlignmentNodeIfc alignment) -
getLine
public hec.map.WorldLine getLine() -
getNodeVector
-
getNodeVectorSorted
check if the node list is unsorted and if so, sort it before returning it- Returns:
- the sorted node list
-
getReferencePt
public hec.map.WorldPt getReferencePt() -
setReferencePt
public void setReferencePt(hec.map.WorldPt pt) -
setLine
-
getLocationByCoord
public hec.map.WorldPt getLocationByCoord(double coord) -
getCoordByLocation
public double getCoordByLocation(hec.map.WorldPt wpt) -
getLocationByStation
public hec.map.WorldPt getLocationByStation(double station) -
getStationByLocation
public double getStationByLocation(hec.map.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
-
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
public void setLinePoint(double coord, hec.map.WorldPt wpt) reset the location of a point on the stream line -
getFieldObject
Description copied from interface:FieldAccessorThis method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObjectin interfaceFieldAccessor- Overrides:
getFieldObjectin classNamedType- Parameters:
fld- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessorThis allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObjectin interfaceFieldAccessor- Overrides:
setFieldObjectin classNamedType- Parameters:
fld- The java field object representing the member field to be setfobj- The data to set in that field- Returns:
- returns true if successful
-
loadId
public boolean loadId() -
locked
public void locked(hec.event.LockEvent event) -
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 interfacerma.lang.Modifiable- Overrides:
isModifiedin classNamedType- Returns:
- true if the object has been modified
-