|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface NamedBean
Provides common services for classes representing objects on the layout, and allows a common form of access by their Managers.
Each object has a two names. The "user" name is entirely free form, and can be used for any purpose. The "system" name is provided by the system-specific implementations, and provides a unique mapping to the layout control system (e.g. LocoNet, NCE, etc) and address within that system.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
AbstractManager,
AbstractNamedBean| Field Summary | |
|---|---|
static int |
INCONSISTENT
Constant representing an "inconsistent" state, indicating that some inconsistency has been detected in the hardware readback. |
static int |
UNKNOWN
Constant representing an "unknown" state, indicating that the object's state is not necessarily that of the actual layout hardware. |
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Request a call-back when a bound property changes. |
void |
dispose()
Deactivate this object, so that it releases as many resources as possible and no longer effects others. |
int |
getNumPropertyChangeListeners()
Number of current listeners. |
int |
getState()
Provide generic access to internal state. |
String |
getSystemName()
Get a system-specific name. |
String |
getUserName()
|
void |
removePropertyChangeListener(PropertyChangeListener l)
Remove a request for a call-back when a bound property changes. |
void |
setState(int s)
Provide generic access to internal state. |
void |
setUserName(String s)
|
| Field Detail |
|---|
static final int UNKNOWN
static final int INCONSISTENT
| Method Detail |
|---|
String getUserName()
void setUserName(String s)
String getSystemName()
void addPropertyChangeListener(PropertyChangeListener l)
void removePropertyChangeListener(PropertyChangeListener l)
int getNumPropertyChangeListeners()
void dispose()
For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.
It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.
Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.
void setState(int s)
throws JmriException
This generally shouldn't be used by Java code; use the class-specific form instead. (E.g. setCommandedState in Turnout) This provided to make Jython script access easier to read.
JmriException - general error when cant do the needed operationint getState()
This generally shouldn't be used by Java code; use the class-specific form instead. (E.g. getCommandedState in Turnout) This provided to make Jython script access easier to read.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||