|
||||||||||
| 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.
Manager| 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)
|
void |
addPropertyChangeListener(PropertyChangeListener l,
String name,
String listenerRef)
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. |
String |
getComment()
Get associated comment text. |
String |
getDisplayName()
|
String |
getListenerRef(PropertyChangeListener l)
Get the textual reference for the specific listener |
ArrayList<String> |
getListenerRefs()
Returns a list of all the listerners references |
int |
getNumPropertyChangeListeners()
Number of current listeners. |
Object |
getProperty(Object key)
Retrieve the value associated with a key. |
ArrayList<PropertyChangeListener> |
getPropertyChangeListeners(String name)
Get a list of all the property change listeners that are registered using a specific name |
Set<Object> |
getPropertyKeys()
Retrieve the complete current set of keys. |
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 |
setComment(String comment)
Set associated comment text. |
void |
setProperty(Object key,
Object value)
Attach a key/value pair to the NamedBean, which can be retrieved later. |
void |
setState(int s)
Provide generic access to internal state. |
void |
setUserName(String s)
|
void |
updateListenerRef(PropertyChangeListener l,
String newName)
|
| Field Detail |
|---|
static final int UNKNOWN
static final int INCONSISTENT
| Method Detail |
|---|
String getUserName()
void setUserName(String s)
String getSystemName()
String getDisplayName()
void addPropertyChangeListener(PropertyChangeListener l,
String name,
String listenerRef)
l - - Listenername - - The name (either system or user) that the listener uses for
this namedBean, this parameter is used to help determine when
which listeners should be moved when the username is moved from
one bean to another.listenerRef - - A textual reference for the listener, that can be
presented to the user when a delete is calledvoid addPropertyChangeListener(PropertyChangeListener l)
void removePropertyChangeListener(PropertyChangeListener l)
void updateListenerRef(PropertyChangeListener l,
String newName)
String getListenerRef(PropertyChangeListener l)
ArrayList<String> getListenerRefs()
int getNumPropertyChangeListeners()
ArrayList<PropertyChangeListener> getPropertyChangeListeners(String name)
name - - The name (either system or user) that the listener has registered as
referencing this namedBeanvoid 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.
String getComment()
void setComment(String comment)
Comments can be any valid text.
comment - Null means no comment associated.
void setProperty(Object key,
Object value)
Object getProperty(Object key)
Set<Object> getPropertyKeys()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||