All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.weatherstation.WeatherStation
java.lang.Object
|
+----com.ibm.weatherstation.WeatherStation
- public class WeatherStation
- extends Object
- implements WeatherStationInterface
This class object is used by the other Weather Station beans to access Dallas Weather Station.
-
WeatherStation()
- Construct a new WeatherStation object.
-
addCommunicationErrorListener(CommunicationErrorListener)
- Add a communicationError listener to the listener list.
-
addPropertyChangeListener(PropertyChangeListener)
- Add a propertyChange listener to the listener list.
-
closePort()
- Close a communication port.
-
firePropertyChange(String, Object, Object)
- Report a bound property update to any registered listeners.
-
getAboutThisBean()
- Gets the aboutThisBean property (java.lang.String) value.
-
getMyself()
- Gets the myself property (com.ibm.weatherstation.WeatherStationInterface) value.
-
getPort()
- Get the port property (java.lang.String) value.
-
getPropertyChange()
- Returns the current PropertyChangeSupport object.
-
openPort()
- Open a communication port.
-
readTemperature()
- Read the current temperature.
-
readWindDirection()
- Read the current wind direction.
-
readWindSpeed()
- Read the current wind speed.
-
removeCommunicationErrorListener(CommunicationErrorListener)
- Remove a communicationError listener from the listener list.
-
removePropertyChangeListener(PropertyChangeListener)
- Remove a propertyChange listener from the listener list.
-
setAboutThisBean(String)
- Sets the aboutThisBean property (java.lang.String) value.
-
setPort(String)
- Set the port property (java.lang.String) value.
WeatherStation
public WeatherStation()
- Construct a new WeatherStation object.
addCommunicationErrorListener
public void addCommunicationErrorListener(CommunicationErrorListener listener)
- Add a communicationError listener to the listener list.
- Parameters:
- listener - com.ibm.weatherstation.event.CommunicationErrorListener
- Throws: IllegalArgumentException
- if listener is null.
addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
- Add a propertyChange listener to the listener list.
- Parameters:
- listener - java.beans.PropertyChangeListener
- Throws: IllegalArgumentException
- if listener is null.
closePort
public void closePort()
- Close a communication port.
firePropertyChange
protected void firePropertyChange(String propertyName,
Object oldValue,
Object newValue)
- Report a bound property update to any registered listeners.
No event is fired if old and new are equal and non-null.
- Parameters:
- propertyName - java.lang.String
- oldValue - java.lang.Object
- newValue - java.lang.Object
getAboutThisBean
public String getAboutThisBean()
- Gets the aboutThisBean property (java.lang.String) value.
- Returns:
- The aboutThisBean property value.
- See Also:
- setAboutThisBean
getMyself
public WeatherStationInterface getMyself()
- Gets the myself property (com.ibm.weatherstation.WeatherStationInterface) value.
- Returns:
- The myself property value.
getPort
public String getPort()
- Get the port property (java.lang.String) value.
- Returns:
- The port property value.
- See Also:
- setPort
getPropertyChange
protected PropertyChangeSupport getPropertyChange()
- Returns the current PropertyChangeSupport object.
- Returns:
- java.beans.PropertyChangeSupport
openPort
protected void openPort()
- Open a communication port.
readTemperature
public synchronized float readTemperature() throws MonitoringException
- Read the current temperature.
- Returns:
- float
- Throws: MonitoringException
- if an error occurs.
readWindDirection
public synchronized char[] readWindDirection() throws MonitoringException
- Read the current wind direction.
- Returns:
- char[]
- Throws: MonitoringException
- if an error occurs.
readWindSpeed
public synchronized float readWindSpeed() throws MonitoringException
- Read the current wind speed.
- Returns:
- float
- Throws: MonitoringException
- if an error occurs.
removeCommunicationErrorListener
public void removeCommunicationErrorListener(CommunicationErrorListener newListener)
- Remove a communicationError listener from the listener list.
- Parameters:
- newListener - com.ibm.weatherstation.event.CommunicationErrorListener
- Throws: IllegalArgumentException
- if newListener is null
removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
- Remove a propertyChange listener from the listener list.
- Parameters:
- listener - java.beans.PropertyChangeListener
- Throws: IllegalArgumentException
- if listener is null
setAboutThisBean
public void setAboutThisBean(String aboutThisBean)
- Sets the aboutThisBean property (java.lang.String) value.
- Parameters:
- aboutThisBean - The new value for the property.
- See Also:
- getAboutThisBean
setPort
public void setPort(String port)
- Set the port property (java.lang.String) value.
- Parameters:
- port - The new value for the property.
- Throws: IllegalArgumentException
- if port is a wrong port name or null.
- See Also:
- getPort
All Packages Class Hierarchy This Package Previous Next Index