Package jmri.jmrit.logix
Class OPath
- java.lang.Object
- 
- jmri.Path
- 
- jmri.jmrit.logix.OPath
 
 
- 
- All Implemented Interfaces:
- java.lang.Comparable<Path>
 
 public class OPath extends Path Extends jmri.Path. An OPath is a route that traverses a Block from one boundary to another. The dest parameter of Path (renamed to owner) is used to reference the Block to which this OPath belongs. (Not a destination Block as might be inferred from the naming in Path.java)An OPath inherits the List of BeanSettings for all the turnouts needed to traverse the Block. It also has references to the Portals (block boundary objects) through which it enters or exits the block. One of these may be null, if the OPath dead ends within the block. 
- 
- 
Field Summary- 
Fields inherited from class jmri.PathCCW, CW, DOWN, EAST, LEFT, NONE, NORTH, NORTH_EAST, NORTH_WEST, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, UP, WEST
 
- 
 - 
Constructor SummaryConstructors Constructor Description OPath(java.lang.String name, OBlock owner, Portal entry, Portal exit, java.util.List<BeanSetting> settings)Create an OPath object with default directions of NONE, and no setting element.OPath(Block owner, java.lang.String name)Create an OPath object with default directions of NONE, and no setting element.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSetting(BeanSetting t)Does not allow duplicate settings.voiddispose()booleanequals(java.lang.Object obj)Override to indicate logical equality for use as paths in OBlocks.java.lang.StringgetDescription()PortalgetFromPortal()java.lang.StringgetName()protected java.lang.StringgetOppositePortalName(java.lang.String name)PortalgetToPortal()inthashCode()voidsetFromPortal(Portal p)voidsetName(java.lang.String name)voidsetToPortal(Portal p)voidsetTurnouts(int delay, boolean set, int lockState, boolean lock)Set path turnout commanded state and lock statejava.lang.StringtoString()- 
Methods inherited from class jmri.PathcheckPathSet, clearSettings, compareTo, computeDirection, decodeDirection, getBlock, getFromBlockDirection, getLength, getLengthCm, getLengthIn, getLengthMm, getSettings, getToBlockDirection, removeSetting, reverseDirection, setBlock, setFromBlockDirection, setLength, setToBlockDirection
 
- 
 
- 
- 
- 
Constructor Detail- 
OPathpublic OPath(Block owner, java.lang.String name) Create an OPath object with default directions of NONE, and no setting element.- Parameters:
- owner- Block owning the path
- name- name of the path
 
 - 
OPathpublic OPath(java.lang.String name, OBlock owner, Portal entry, Portal exit, java.util.List<BeanSetting> settings) Create an OPath object with default directions of NONE, and no setting element.- Parameters:
- owner- Block owning the path
- name- name of the path
- entry- Portal where path enters
- exit- Portal where path exits
- settings- array of turnout settings of the path
 
 
- 
 - 
Method Detail- 
getOppositePortalNameprotected java.lang.String getOppositePortalName(java.lang.String name) 
 - 
setNamepublic void setName(java.lang.String name) 
 - 
getNamepublic java.lang.String getName() 
 - 
setFromPortalpublic void setFromPortal(Portal p) 
 - 
getFromPortalpublic Portal getFromPortal() 
 - 
setToPortalpublic void setToPortal(Portal p) 
 - 
getToPortalpublic Portal getToPortal() 
 - 
setTurnoutspublic void setTurnouts(int delay, boolean set, int lockState, boolean lock) Set path turnout commanded state and lock state- Parameters:
- delay- following actions in seconds
- set- when true, command turnout to settings, false don't set command - just do lock setting
- lockState- set when lock==true, lockState unset when lock==false
- lock- If lockState==0 setLocked() is not called. (lockState should be 1,2,3)
 
 - 
disposepublic void dispose() 
 - 
getDescriptionpublic java.lang.String getDescription() 
 - 
addSettingpublic void addSetting(BeanSetting t) Does not allow duplicate settings.- Overrides:
- addSettingin class- Path
 
 
- 
 
-