Class RollingStockGroup<T extends RollingStock>

java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.rollingstock.RollingStockGroup<T>
Type Parameters:
T - the type of RollingStock in this group
All Implemented Interfaces:
PropertyChangeFirer, PropertyChangeProvider
Direct Known Subclasses:
Consist, Kernel

public abstract class RollingStockGroup<T extends RollingStock> extends PropertyChangeSupport
A group of rolling stock that is managed as one unit.
  • Field Details

  • Constructor Details

  • Method Details

    • getName

      public String getName()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • add

      public void add(T rs)
    • delete

      public void delete(T rs)
    • getGroup

      public List<T> getGroup()
    • getTotalLength

      public int getTotalLength()
    • getAdjustedWeightTons

      public int getAdjustedWeightTons()
      Get a group's adjusted weight
      Returns:
      group's weight
    • isLead

      public boolean isLead(T rs)
    • getLead

      public T getLead()
    • getSize

      public int getSize()
      Gets the number of rolling stock in this group
      Returns:
      number of elements in this group
    • setLead

      public void setLead(T 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.
    • removeLead

      public void removeLead(T rs)
    • dispose

      public void dispose()