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,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) This method allows access to java.lang.reflect.Field objects within the implementing class.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 nodesdoublegetStationByCoord(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) This allows access to fields withing the implementing object to set there data.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
-
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
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
-
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
-