jmri.jmrit.operations.rollingstock
Class RollingStockGroup
java.lang.Object
jmri.jmrit.operations.rollingstock.RollingStockGroup
- Direct Known Subclasses:
- Consist, Kernel
public class RollingStockGroup
- extends Object
A group of rolling stock that is managed as one unit.
- Author:
- Daniel Boudreau Copyright (C) 2010
_name
protected String _name
_lead
protected RollingStock _lead
_group
protected List<RollingStock> _group
RollingStockGroup
public RollingStockGroup(String name)
getName
public String getName()
toString
public String toString()
- Overrides:
toString in class Object
add
public void add(RollingStock rs)
delete
public void delete(RollingStock rs)
getGroup
public List<RollingStock> getGroup()
getLength
public int getLength()
getAdjustedWeightTons
public int getAdjustedWeightTons()
- Get a group's adjusted weight
- Returns:
- group's weight
isLead
public boolean isLead(RollingStock rs)
getSize
public int getSize()
- Gets the number of rolling stock in this group
- Returns:
- number of elements in this group
setLead
public void setLead(RollingStock rs)
- Sets the lead for this group. RollingStock must be part of the group. The
rolling stock that make up this group will have the attributes of the
lead. However, the length attribute is the sum of all unit lengths
plus the coupler lengths.
- Parameters:
rs - lead for this group.
dispose
public void dispose()
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
firePropertyChange
protected void firePropertyChange(String p,
Object old,
Object n)
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: