Class DivisionManager
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.locations.divisions.DivisionManager
- All Implemented Interfaces:
PropertyChangeFirer,PropertyChangeProvider,InstanceManagerAutoDefault,InstanceManagerAutoInitialize
public class DivisionManager
extends PropertyChangeSupport
implements InstanceManagerAutoDefault, InstanceManagerAutoInitialize
Manages divisions.
-
Field Summary
FieldsFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidderegister(Division division) Forget a NamedBean Object created outside the manager.voiddispose()getDivisionByName(String name) Sort by Division idSort by Division namegetList()Gets an unsorted list of all divisions.intintvoidPerform any initialization that occurs after this object has been constructed and made available by the InstanceManager.voidload(org.jdom2.Element root) newDivision(String name) Finds an existing Division or creates a new Division if needed requires Division's name creates a unique id for this DivisionvoidRemember a NamedBean Object created outside the manager.protected voidsetDirtyAndFirePropertyChange(String p, Object old, Object n) voidstore(org.jdom2.Element root) voidupdateComboBox(JComboBox<Division> box) Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
LISTLENGTH_CHANGED_PROPERTY
- See Also:
-
_divisionHashTable
-
_maxDivisionNameLength
-
-
Constructor Details
-
DivisionManager
public DivisionManager()
-
-
Method Details
-
dispose
-
getNumberOfdivisions
- Returns:
- Number of divisions
-
getDivisionByName
- Parameters:
name- The string name of the Division to get.- Returns:
- requested Division object or null if none exists
-
getDivisionById
-
newDivision
Finds an existing Division or creates a new Division if needed requires Division's name creates a unique id for this Division- Parameters:
name- The string name for a new Division.- Returns:
- new Division or existing Division
-
register
Remember a NamedBean Object created outside the manager.- Parameters:
division- The Division to add.
-
deregister
Forget a NamedBean Object created outside the manager.- Parameters:
division- The Division to delete.
-
getDivisionsByNameList
Sort by Division name- Returns:
- list of divisions ordered by name
-
getDivisionsByIdList
Sort by Division id- Returns:
- list of divisions ordered by id numbers
-
getList
Gets an unsorted list of all divisions.- Returns:
- All divisions.
-
getComboBox
- Returns:
- ComboBox with divisions for this railroad
-
updateComboBox
-
getMaxDivisionNameLength
-
load
-
store
-
setDirtyAndFirePropertyChange
-
initialize
Description copied from interface:InstanceManagerAutoInitializePerform any initialization that occurs after this object has been constructed and made available by the InstanceManager.- Specified by:
initializein interfaceInstanceManagerAutoInitialize
-