stella.sensor
Class WeatherEvent

java.lang.Object
  extended by java.util.EventObject
      extended by util.rmi.RmiEvent
          extended by stella.sensor.WeatherEvent
All Implemented Interfaces:
Serializable, AlarmingEvent

public class WeatherEvent
extends RmiEvent
implements AlarmingEvent

This event is generated, whenever the weather situation changes. As a rule of thumb, always use raw sensor datas to generate this type of event. Additionally to normal events, this object carry information about:

Note that this type of event is not intended for use if someone is interested in the data a sensor produces. It is only meant to signal exceptional events that indicate a change of observation conditions.
If you are interested in the data a sensor generates, use the DataEvent or its subclasses instead.

See Also:
Serialized Form

Field Summary
static int ANYRETARD
          The mask for any retardation.
static int ANYTHRESHOLD
          The mask for any threshold exceed.
static int DERIVATIVERETARD
          The flag indicating that a sensor is derivative retarding.
static int DERIVATIVETHRESHOLD
          The flag indicating that a sensor's reading changed too fast.
private  boolean good
          True if weather is good.
static int GOOD
          The reason-field for good weather.
static int PREDICTIVERETARD
          The flag indicating that a sensor is prediction retarding.
static int PREDICTIVETHRESHOLD
          The flag indicating that a sensor's reading is predicted bad.
static int RAWRETARD
          The flag indicating that a sensor is raw retarding.
static int RAWTHRESHOLD
          The flag indicating that a sensor entered or left its threshold value for the raw reading.
private  int reason
          The logical or of the reasons why this event occured.
static int SMOOTHRETARD
          The flag indicating that a sensor is smooth retarding.
static int SMOOTHTHRESHOLD
          The flag indicating that a sensor entered or left its threshold value for the smoothened reading.
static int UNKNOWN
          The flag indicating that the source of the bad weather is unknown.
 
Fields inherited from class util.rmi.RmiEvent
localHost, sourceName
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
WeatherEvent(Object src, boolean isgood, int isreason)
          A fully qualified weather event.
 
Method Summary
 int getReason()
          Returns the reason of occurence for this weather event.
 boolean isGood()
          Returns true if the weather situation is now clear.
 String toString()
          Returns a string description of the weather event.
 
Methods inherited from class util.rmi.RmiEvent
getHost, getSourceName, setSourceName
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RAWTHRESHOLD

public static final int RAWTHRESHOLD
The flag indicating that a sensor entered or left its threshold value for the raw reading.

See Also:
Constant Field Values

SMOOTHTHRESHOLD

public static final int SMOOTHTHRESHOLD
The flag indicating that a sensor entered or left its threshold value for the smoothened reading.

See Also:
Constant Field Values

DERIVATIVETHRESHOLD

public static final int DERIVATIVETHRESHOLD
The flag indicating that a sensor's reading changed too fast.

See Also:
Constant Field Values

PREDICTIVETHRESHOLD

public static final int PREDICTIVETHRESHOLD
The flag indicating that a sensor's reading is predicted bad.

See Also:
Constant Field Values

RAWRETARD

public static final int RAWRETARD
The flag indicating that a sensor is raw retarding.

See Also:
Constant Field Values

SMOOTHRETARD

public static final int SMOOTHRETARD
The flag indicating that a sensor is smooth retarding.

See Also:
Constant Field Values

DERIVATIVERETARD

public static final int DERIVATIVERETARD
The flag indicating that a sensor is derivative retarding.

See Also:
Constant Field Values

PREDICTIVERETARD

public static final int PREDICTIVERETARD
The flag indicating that a sensor is prediction retarding.

See Also:
Constant Field Values

UNKNOWN

public static final int UNKNOWN
The flag indicating that the source of the bad weather is unknown.

See Also:
Constant Field Values

GOOD

public static final int GOOD
The reason-field for good weather.

See Also:
Constant Field Values

ANYTHRESHOLD

public static final int ANYTHRESHOLD
The mask for any threshold exceed.

See Also:
Constant Field Values

ANYRETARD

public static final int ANYRETARD
The mask for any retardation.

See Also:
Constant Field Values

good

private boolean good
True if weather is good.


reason

private int reason
The logical or of the reasons why this event occured.

Constructor Detail

WeatherEvent

public WeatherEvent(Object src,
                    boolean isgood,
                    int isreason)
A fully qualified weather event.

Method Detail

isGood

public boolean isGood()
Returns true if the weather situation is now clear. There is no appropriate setGood method, because this is a read-only property.


getReason

public int getReason()
Returns the reason of occurence for this weather event. Note to always and the returned value with the desired reason that directly comparing it to this variable.


toString

public String toString()
Returns a string description of the weather event.

Overrides:
toString in class RmiEvent