Class TrackNode
Used in conjunction with ConnectivityUtil.java to return information about track nodes following a search of layout connectivity.
Track nodes are nodes in the layout connectivity diagram. They may be: positionable points - either anchor points that define a block boundary or end bumpers (end of a track), turnouts, -OR_ level crossings
The components of a TrackNode are: Node Object - the object reached by searching connectivity Node Type - connection types defined in Layout Editor, for example, TURNOUT_A, indicates a turnout connected at A (the throat of a RH, LH, or WYE turnout) Track Segment - the track segment connected at the connection point specified in Node Type Reached End Bumper - 'true' if the connectivity search has reached an end bumper (the end of the search track) before reaching a Node Object. 'false' otherwise. Node State - if the Node Object can have multiple states, for example, a turnout, this gives the state it was when finding this track node.
Actually you could think of an End Bumper as a 'Node', but End Bumpers are treated differently here. When an End Bumper is reached during a connectivity search, Track Segment is returned, Reached End Bumper is set true, and Node Object and Node Type, are not returned.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) LayoutTrack(package private) int(package private) HitPointType(package private) boolean(package private) TrackSegment -
Constructor Summary
ConstructorsConstructorDescriptionTrackNode(LayoutTrack node, HitPointType nodeType, TrackSegment segment, boolean endBumper, int nodeState) -
Method Summary
Modifier and TypeMethodDescriptiongetNode()Get the node block.intbooleanvoidsetNode(LayoutTrack node) Set the node.voidsetNodeType(HitPointType type) voidsetReachedEndBumper(boolean end) void
-
Field Details
-
_Node
-
_NodeType
-
_TrackSegment
-
_ReachedEndBumper
boolean _ReachedEndBumper -
_NodeState
int _NodeState
-
-
Constructor Details
-
TrackNode
public TrackNode(LayoutTrack node, HitPointType nodeType, TrackSegment segment, boolean endBumper, int nodeState)
-
-
Method Details
-
setNode
Set the node.- Parameters:
node- the layout track node.
-
getNode
-
setNodeType
-
getNodeType
-
setTrackSegment
-
getTrackSegment
-
setReachedEndBumper
-
reachedEndOfTrack
-
getNodeState
-
getNodeBlock
Get the node block.- Returns:
- the Block of the node Object at the nodeType position, may be null.
-