dk.itu.haas.GPS.services
Class AreaAlarm

java.lang.Object
  |
  +--dk.itu.haas.GPS.services.AreaAlarm
All Implemented Interfaces:
IGPSlistener

public class AreaAlarm
extends java.lang.Object
implements IGPSlistener

This class implements an AreaAlarm-service. The class allows the user to specify two positions, which will be used as opposite corners in a rectangular area. Whenever the GPS enters or exits the area all listeners are notified through the IAlarmListener-interface.


Constructor Summary
AreaAlarm(GPS g, Position p1, Position p2)
           
 
Method Summary
 void addAlarmListener(IAlarmListener l)
          Adds l to the list of listeners interested in receiving notification when the GPS enters or exits the area.
 void dateReceived(IDate d)
          Invoked when the GPS transmits date-data.
protected  void fireInside()
          This method propagates the information that the gps has entered the area to all listeners.
protected  void fireOutside()
          This method propagates the information that the gps has exited the area to all listeners.
 void positionReceived(IPosition pos)
          Invoked when the GPS transmits position-data.
 void removeAlarmListener(IAlarmListener l)
          Removes the the Alarm-listener l from the list of Waypoint-listeners.
 void timeReceived(ITime t)
          Invoked when the GPS transmits time-data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AreaAlarm

public AreaAlarm(GPS g,
                 Position p1,
                 Position p2)
Method Detail

addAlarmListener

public void addAlarmListener(IAlarmListener l)
Adds l to the list of listeners interested in receiving notification when the GPS enters or exits the area.


removeAlarmListener

public void removeAlarmListener(IAlarmListener l)
Removes the the Alarm-listener l from the list of Waypoint-listeners.


fireOutside

protected void fireOutside()
This method propagates the information that the gps has exited the area to all listeners.


fireInside

protected void fireInside()
This method propagates the information that the gps has entered the area to all listeners.


timeReceived

public void timeReceived(ITime t)
Description copied from interface: IGPSlistener
Invoked when the GPS transmits time-data.

Specified by:
timeReceived in interface IGPSlistener

dateReceived

public void dateReceived(IDate d)
Description copied from interface: IGPSlistener
Invoked when the GPS transmits date-data.

Specified by:
dateReceived in interface IGPSlistener

positionReceived

public void positionReceived(IPosition pos)
Description copied from interface: IGPSlistener
Invoked when the GPS transmits position-data.

Specified by:
positionReceived in interface IGPSlistener