|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.Path
public class 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:
This implementation handles paths with a list of bean settings. This has been extended from the initial implementation.
| Field Summary | |
|---|---|
static int |
CCW
Counter-clockwise |
static int |
CW
Clockwise |
static int |
DOWN
Downward, e.g. on a schematic diagram or CTC panel |
static int |
EAST
Eastward |
static int |
LEFT
Leftward, e.g. on a schematic diagram or CTC panel |
static int |
NONE
Direction not known or not specified. |
static int |
NORTH
Northward |
static int |
RIGHT
Rightward, e.g. on a schematic diagram or CTC panel |
static int |
SOUTH
Southward |
static int |
UP
Upward, e.g. on a schematic diagram or CTC panel |
static int |
WEST
Westward |
| Constructor Summary | |
|---|---|
Path()
Create an object with default directions of NONE, and no setting element. |
|
Path(Block dest,
int toBlockDirection,
int fromBlockDirection)
Convenience constructor to set the destination/source block and directions in one call. |
|
Path(Block dest,
int toBlockDirection,
int fromBlockDirection,
BeanSetting setting)
Convenience constructor to set the destination/source block, directions and a single setting element in one call. |
|
| Method Summary | |
|---|---|
void |
addSetting(BeanSetting t)
|
boolean |
checkPathSet()
Check that the Path can be traversed. |
void |
clearSettings()
|
static String |
decodeDirection(int d)
Decode the direction constants into a human-readable form. |
Block |
getBlock()
|
int |
getFromBlockDirection()
|
List |
getSettings()
|
int |
getToBlockDirection()
|
void |
setBlock(Block b)
|
void |
setFromBlockDirection(int d)
|
void |
setToBlockDirection(int d)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NONE
public static final int NORTH
public static final int SOUTH
public static final int EAST
public static final int WEST
public static final int CW
public static final int CCW
public static final int LEFT
public static final int RIGHT
public static final int UP
public static final int DOWN
| Constructor Detail |
|---|
public Path()
public Path(Block dest,
int toBlockDirection,
int fromBlockDirection)
public Path(Block dest,
int toBlockDirection,
int fromBlockDirection,
BeanSetting setting)
| Method Detail |
|---|
public void addSetting(BeanSetting t)
public List getSettings()
public void clearSettings()
public void setBlock(Block b)
public Block getBlock()
public int getToBlockDirection()
public void setToBlockDirection(int d)
public int getFromBlockDirection()
public void setFromBlockDirection(int d)
public boolean checkPathSet()
public static String decodeDirection(int d)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||