jmri.jmrix.nce.consist
Class NceConsistRosterEntry

java.lang.Object
  extended by jmri.jmrix.nce.consist.NceConsistRosterEntry

public class NceConsistRosterEntry
extends Object

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.

Author:
Bob Jacobsen Copyright (C) 2001, 2002, 2004, 2005, Dennis Miller Copyright 2004, Daniel Boudreau (C) 2008
See Also:
NceConsistRoster

Field Summary
protected  String _comment
           
protected  String _consistNumber
           
protected  String _fileName
           
protected  String _id
           
protected  boolean _isLoco1LongAddress
           
protected  boolean _isLoco2LongAddress
           
protected  boolean _isLoco3LongAddress
           
protected  boolean _isLoco4LongAddress
           
protected  boolean _isLoco5LongAddress
           
protected  boolean _isLoco6LongAddress
           
protected  String _loco1DccAddress
           
protected  String _loco1Direction
           
protected  String _loco2DccAddress
           
protected  String _loco2Direction
           
protected  String _loco3DccAddress
           
protected  String _loco3Direction
           
protected  String _loco4DccAddress
           
protected  String _loco4Direction
           
protected  String _loco5DccAddress
           
protected  String _loco5Direction
           
protected  String _loco6DccAddress
           
protected  String _loco6Direction
           
protected  String _model
           
protected  String _roadName
           
protected  String _roadNumber
           
 
Constructor Summary
NceConsistRosterEntry()
          Construct a blank object.
NceConsistRosterEntry(Element e)
          Construct this Entry from XML.
NceConsistRosterEntry(NceConsistRosterEntry pEntry, String pID)
           
 
Method Summary
 String getComment()
           
 String getConsistNumber()
           
 String getId()
           
 String getLoco1DccAddress()
           
 String getLoco1Direction()
           
 String getLoco2DccAddress()
           
 String getLoco2Direction()
           
 String getLoco3DccAddress()
           
 String getLoco3Direction()
           
 String getLoco4DccAddress()
           
 String getLoco4Direction()
           
 String getLoco5DccAddress()
           
 String getLoco5Direction()
           
 String getLoco6DccAddress()
           
 String getLoco6Direction()
           
 String getModel()
           
 String getRoadName()
           
 String getRoadNumber()
           
 boolean isLoco1LongAddress()
           
 boolean isLoco2LongAddress()
           
 boolean isLoco3LongAddress()
           
 boolean isLoco4LongAddress()
           
 boolean isLoco5LongAddress()
           
 boolean isLoco6LongAddress()
           
 void printEntry(Writer w)
          Prints the roster information.
 void setComment(String s)
           
 void setConsistNumber(String s)
           
 void setId(String s)
           
 void setLoco1DccAddress(String s)
           
 void setLoco1Direction(String s)
           
 void setLoco1LongAddress(boolean b)
           
 void setLoco2DccAddress(String s)
           
 void setLoco2Direction(String s)
           
 void setLoco2LongAddress(boolean b)
           
 void setLoco3DccAddress(String s)
           
 void setLoco3Direction(String s)
           
 void setLoco3LongAddress(boolean b)
           
 void setLoco4DccAddress(String s)
           
 void setLoco4Direction(String s)
           
 void setLoco4LongAddress(boolean b)
           
 void setLoco5DccAddress(String s)
           
 void setLoco5Direction(String s)
           
 void setLoco5LongAddress(boolean b)
           
 void setLoco6DccAddress(String s)
           
 void setLoco6Direction(String s)
           
 void setLoco6LongAddress(boolean b)
           
 void setModel(String s)
           
 void setRoadName(String s)
           
 void setRoadNumber(String s)
           
 String titleString()
           
 String toString()
           
 Vector<String> wrapComment(String comment, int textSpace)
          Take a String comment field and perform line wrapping on it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_fileName

protected String _fileName

_id

protected String _id

_consistNumber

protected String _consistNumber

_roadName

protected String _roadName

_roadNumber

protected String _roadNumber

_model

protected String _model

_loco1DccAddress

protected String _loco1DccAddress

_isLoco1LongAddress

protected boolean _isLoco1LongAddress

_loco1Direction

protected String _loco1Direction

_loco2DccAddress

protected String _loco2DccAddress

_isLoco2LongAddress

protected boolean _isLoco2LongAddress

_loco2Direction

protected String _loco2Direction

_loco3DccAddress

protected String _loco3DccAddress

_isLoco3LongAddress

protected boolean _isLoco3LongAddress

_loco3Direction

protected String _loco3Direction

_loco4DccAddress

protected String _loco4DccAddress

_isLoco4LongAddress

protected boolean _isLoco4LongAddress

_loco4Direction

protected String _loco4Direction

_loco5DccAddress

protected String _loco5DccAddress

_isLoco5LongAddress

protected boolean _isLoco5LongAddress

_loco5Direction

protected String _loco5Direction

_loco6DccAddress

protected String _loco6DccAddress

_isLoco6LongAddress

protected boolean _isLoco6LongAddress

_loco6Direction

protected String _loco6Direction

_comment

protected String _comment
Constructor Detail

NceConsistRosterEntry

public NceConsistRosterEntry()
Construct a blank object.


NceConsistRosterEntry

public NceConsistRosterEntry(NceConsistRosterEntry pEntry,
                             String pID)

NceConsistRosterEntry

public NceConsistRosterEntry(Element e)
Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in consist-roster-config.xml

Parameters:
e - Consist XML element
Method Detail

setId

public void setId(String s)

getId

public String getId()

setConsistNumber

public void setConsistNumber(String s)

getConsistNumber

public String getConsistNumber()

setRoadName

public void setRoadName(String s)

getRoadName

public String getRoadName()

setRoadNumber

public void setRoadNumber(String s)

getRoadNumber

public String getRoadNumber()

setModel

public void setModel(String s)

getModel

public String getModel()

setLoco1DccAddress

public void setLoco1DccAddress(String s)

getLoco1DccAddress

public String getLoco1DccAddress()

setLoco1LongAddress

public void setLoco1LongAddress(boolean b)

isLoco1LongAddress

public boolean isLoco1LongAddress()

setLoco1Direction

public void setLoco1Direction(String s)

getLoco1Direction

public String getLoco1Direction()

setLoco2DccAddress

public void setLoco2DccAddress(String s)

getLoco2DccAddress

public String getLoco2DccAddress()

setLoco2LongAddress

public void setLoco2LongAddress(boolean b)

isLoco2LongAddress

public boolean isLoco2LongAddress()

setLoco2Direction

public void setLoco2Direction(String s)

getLoco2Direction

public String getLoco2Direction()

setLoco3DccAddress

public void setLoco3DccAddress(String s)

getLoco3DccAddress

public String getLoco3DccAddress()

setLoco3LongAddress

public void setLoco3LongAddress(boolean b)

isLoco3LongAddress

public boolean isLoco3LongAddress()

setLoco3Direction

public void setLoco3Direction(String s)

getLoco3Direction

public String getLoco3Direction()

setLoco4DccAddress

public void setLoco4DccAddress(String s)

getLoco4DccAddress

public String getLoco4DccAddress()

setLoco4LongAddress

public void setLoco4LongAddress(boolean b)

isLoco4LongAddress

public boolean isLoco4LongAddress()

setLoco4Direction

public void setLoco4Direction(String s)

getLoco4Direction

public String getLoco4Direction()

setLoco5DccAddress

public void setLoco5DccAddress(String s)

getLoco5DccAddress

public String getLoco5DccAddress()

setLoco5LongAddress

public void setLoco5LongAddress(boolean b)

isLoco5LongAddress

public boolean isLoco5LongAddress()

setLoco5Direction

public void setLoco5Direction(String s)

getLoco5Direction

public String getLoco5Direction()

setLoco6DccAddress

public void setLoco6DccAddress(String s)

getLoco6DccAddress

public String getLoco6DccAddress()

setLoco6LongAddress

public void setLoco6LongAddress(boolean b)

isLoco6LongAddress

public boolean isLoco6LongAddress()

setLoco6Direction

public void setLoco6Direction(String s)

getLoco6Direction

public String getLoco6Direction()

setComment

public void setComment(String s)

getComment

public String getComment()

titleString

public String titleString()

toString

public String toString()
Overrides:
toString in class Object

printEntry

public void printEntry(Writer w)
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


wrapComment

public Vector<String> wrapComment(String comment,
                                  int textSpace)
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



Copyright © 1997 - 2011 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: Get JMRI Model Railroad Interface at SourceForge.net. Fast, secure and Free Open Source software downloads