Package jmri

Class Path

java.lang.Object
jmri.Path
All Implemented Interfaces:
Comparable<Path>
Direct Known Subclasses:
OPath

public class Path
extends Object
implements Comparable<Path>
Represents a particular set of NamedBean (usually turnout) settings to put a path through trackwork to a Block.

Directions are defined for traffic along this path "to" the block, and "from" the block. Being more specific:

  • The "to" direction is the direction that a train is going when it traverses this path "to" the final block.
  • The "from" direction is the direction that a train is going when it traverses this path "from" the final block.
Although useful constants are defined, you don't have to restrict to those, and there's no assumption that they have to be opposites; NORTH for "to" does not imply SOUTH for "from". This allows you to e.g. handle a piece of curved track where you can be going LEFT at one point and UP at another. The constants are defined as bits, so you can use more than one at a time, for example a direction can simultanously be EAST and RIGHT if desired. What that means needs to be defined by whatever object is using this Path.

This implementation handles paths with a list of bean settings. This has been extended from the initial implementation.

The length of the path may also optionally be entered if desired. This attribute is for use in automatic running of trains. Length should be the actual length of model railroad track in the path. It is always stored here in millimeter units. A length of 0.0 indicates no entry of length by the user. If there is no entry the length of the block the path is in will be returned. An Entry is only needed when there are paths of greatly different lengths in the block.