Package jmri.jmrix.nce.consist
Class NceConsistRosterEntry
java.lang.Object
jmri.jmrix.nce.consist.NceConsistRosterEntry
ConsistRosterEntry represents a single element in a consist roster.
The ConsistRosterEntry is the central place to find information about a consists configuration, including loco address, address type, loco's direction, and consist number. Up to six consist locos are currently tracked. ConsistRosterEntry handles persistency through the LocoFile class. Creating a ConsistRosterEntry does not necessarily read the corresponding file (which might not even exist), please see readFile(), writeFile() member functions.
All the data attributes have a content, not null.
When the filePath attribute is non-null, the user has decided to organize the roster into directories.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Stringprotected Stringprotected Stringprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected booleanprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected Stringprotected String -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a blank object.NceConsistRosterEntry(NceConsistRosterEntry pEntry, String pID) NceConsistRosterEntry(org.jdom2.Element e) Construct this Entry from XML. -
Method Summary
Modifier and TypeMethodDescriptiongetId()getModel()booleanbooleanbooleanbooleanbooleanbooleanvoidprintEntry(Writer w) Prints the roster information.voidsetComment(String s) voidvoidvoidvoidvoidsetLoco1LongAddress(boolean b) voidvoidvoidsetLoco2LongAddress(boolean b) voidvoidvoidsetLoco3LongAddress(boolean b) voidvoidvoidsetLoco4LongAddress(boolean b) voidvoidvoidsetLoco5LongAddress(boolean b) voidvoidvoidsetLoco6LongAddress(boolean b) voidvoidvoid(package private) org.jdom2.Elementstore()Create an XML element to represent this Entry.toString()wrapComment(String comment, int textSpace) Take a String comment field and perform line wrapping on it.
-
Field Details
-
_fileName
-
_id
-
_consistNumber
-
_roadName
-
_roadNumber
-
_model
-
_loco1DccAddress
-
_isLoco1LongAddress
-
_loco1Direction
-
_loco2DccAddress
-
_isLoco2LongAddress
-
_loco2Direction
-
_loco3DccAddress
-
_isLoco3LongAddress
-
_loco3Direction
-
_loco4DccAddress
-
_isLoco4LongAddress
-
_loco4Direction
-
_loco5DccAddress
-
_isLoco5LongAddress
-
_loco5Direction
-
_loco6DccAddress
-
_isLoco6LongAddress
-
_loco6Direction
-
_comment
-
-
Constructor Details
-
NceConsistRosterEntry
public NceConsistRosterEntry()Construct a blank object. -
NceConsistRosterEntry
-
NceConsistRosterEntry
Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in xml/DTD/consist-roster-config.dtd.- Parameters:
e- Consist XML element
-
-
Method Details
-
setId
-
getId
-
setConsistNumber
-
getConsistNumber
-
setRoadName
-
getRoadName
-
setRoadNumber
-
getRoadNumber
-
setModel
-
getModel
-
setLoco1DccAddress
-
getLoco1DccAddress
-
setLoco1LongAddress
-
isLoco1LongAddress
-
setLoco1Direction
-
getLoco1Direction
-
setLoco2DccAddress
-
getLoco2DccAddress
-
setLoco2LongAddress
-
isLoco2LongAddress
-
setLoco2Direction
-
getLoco2Direction
-
setLoco3DccAddress
-
getLoco3DccAddress
-
setLoco3LongAddress
-
isLoco3LongAddress
-
setLoco3Direction
-
getLoco3Direction
-
setLoco4DccAddress
-
getLoco4DccAddress
-
setLoco4LongAddress
-
isLoco4LongAddress
-
setLoco4Direction
-
getLoco4Direction
-
setLoco5DccAddress
-
getLoco5DccAddress
-
setLoco5LongAddress
-
isLoco5LongAddress
-
setLoco5Direction
-
getLoco5Direction
-
setLoco6DccAddress
-
getLoco6DccAddress
-
setLoco6LongAddress
-
isLoco6LongAddress
-
setLoco6Direction
-
getLoco6Direction
-
setComment
-
getComment
-
store
org.jdom2.Element store()Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in xml/DTD/consist-roster-config.dtd.- Returns:
- Contents in a JDOM Element
-
titleString
-
toString
-
printEntry
Prints the roster information. Updated to allow for multiline comment field. Created separate write statements for text and line feeds to work around the HardcopyWriter bug that misplaces borders.- Parameters:
w- stream to printer
-
wrapComment
Take a String comment field and perform line wrapping on it. String must be non-null and may or may not have \n characters embedded. textSpace is the width of the space to print for wrapping purposes. The comment is wrapped on a word wrap basis This is exactly the same as RosterEntry.wrapComment- Parameters:
comment- string comment from consist roster entrytextSpace- size of space to wrap text into- Returns:
- wrap formated comment
-