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 TypeMethodDescriptionvoid
addNode
(StreamNode node) void
deleteStreamNode
(StreamNode node) boolean
double
double
getCoordByStation
(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) double
get the center of longest interval between nodesdouble
getStationByCoord
(double coord) Given a stream coordinate, return a station based on stream node stations.double
Given a location, find the nearest station.boolean
Check if the object has been modified.boolean
loadId()
void
boolean
readData
(BufferedReader input) void
void
Method to reverse the upstream to downstream orientation of the stream element.void
setAlignment
(StreamAlignmentNodeIfc alignment) boolean
setFieldObject
(Field fld, Object fobj) This allows access to fields withing the implementing object to set there data.void
setLine
(StreamPolyLine reg) void
setLinePoint
(double coord, WorldPt wpt) reset the location of a point on the stream linevoid
Set the NamedTypes's name to the argument String.void
toString()
boolean
writeData
(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, useRecursiveModifiedTest
Methods 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:FieldAccessor
This method allows access to java.lang.reflect.Field objects within the implementing class.- Specified by:
getFieldObject
in interfaceFieldAccessor
- Overrides:
getFieldObject
in classNamedType
- Parameters:
fld
- The field to get.- Returns:
- The data object that is stored in the given field
-
setFieldObject
Description copied from interface:FieldAccessor
This allows access to fields withing the implementing object to set there data.- Specified by:
setFieldObject
in interfaceFieldAccessor
- Overrides:
setFieldObject
in 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:NamedType
Set the NamedTypes's name to the argument String. -
isModified
public boolean isModified()Description copied from class:NamedType
Check if the object has been modified.- Specified by:
isModified
in interfaceModifiable
- Overrides:
isModified
in classNamedType
- Returns:
- true if the object has been modified
-