jmri
Class AbstractNamedBean

java.lang.Object
  extended by jmri.AbstractNamedBean
All Implemented Interfaces:
Serializable, NamedBean
Direct Known Subclasses:
AbstractLight, AbstractMemory, AbstractReporter, AbstractSensor, AbstractSignalHead, AbstractTurnout, Block, DefaultConditional, DefaultLogix, DefaultRoute, LayoutBlock

public abstract class AbstractNamedBean
extends Object
implements NamedBean, Serializable

Abstract base for the NamedBean interface.

Implements the parameter binding support.

Author:
Bob Jacobsen Copyright (C) 2001
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Constructor Summary
AbstractNamedBean(String sys)
           
AbstractNamedBean(String sys, String user)
           
 
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.
protected  void firePropertyChange(String p, Object old, Object n)
           
 int getNumPropertyChangeListeners()
          Number of current listeners.
 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 setUserName(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jmri.NamedBean
getState, setState
 

Constructor Detail

AbstractNamedBean

public AbstractNamedBean(String sys)

AbstractNamedBean

public AbstractNamedBean(String sys,
                         String user)
Method Detail

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Description copied from interface: NamedBean
Request a call-back when a bound property changes. Bound properties are the known state, commanded state, user and system names.

Specified by:
addPropertyChangeListener in interface NamedBean

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Description copied from interface: NamedBean
Remove a request for a call-back when a bound property changes.

Specified by:
removePropertyChangeListener in interface NamedBean

getNumPropertyChangeListeners

public int getNumPropertyChangeListeners()
Number of current listeners. May return -1 if the information is not available for some reason.

Specified by:
getNumPropertyChangeListeners in interface NamedBean

getSystemName

public String getSystemName()
Description copied from interface: NamedBean
Get a system-specific name. This encodes the hardware addressing information.

Specified by:
getSystemName in interface NamedBean

getUserName

public String getUserName()
Specified by:
getUserName in interface NamedBean

setUserName

public void setUserName(String s)
Specified by:
setUserName in interface NamedBean

firePropertyChange

protected void firePropertyChange(String p,
                                  Object old,
                                  Object n)

dispose

public void dispose()
Description copied from interface: NamedBean
Deactivate this object, so that it releases as many resources as possible and no longer effects others.

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.

Specified by:
dispose in interface NamedBean


Copyright © 1997 - 2008 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: SourceForge_Logo