org.jscience.devices.gps.services
Class AreaAlarm

java.lang.Object
  extended by org.jscience.devices.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)
          Creates a new AreaAlarm object.
 
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)
          DOCUMENT ME!
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)
          DOCUMENT ME!
 void removeAlarmListener(IAlarmListener l)
          Removes the the Alarm-listener l from the list of Waypoint-listeners.
 void timeReceived(ITime t)
          DOCUMENT ME!
 
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)
Creates a new AreaAlarm object.

Parameters:
g - DOCUMENT ME!
p1 - DOCUMENT ME!
p2 - DOCUMENT ME!
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.

Parameters:
l - DOCUMENT ME!

removeAlarmListener

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

Parameters:
l - DOCUMENT ME!

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)
DOCUMENT ME!

Specified by:
timeReceived in interface IGPSlistener
Parameters:
t - DOCUMENT ME!

dateReceived

public void dateReceived(IDate d)
DOCUMENT ME!

Specified by:
dateReceived in interface IGPSlistener
Parameters:
d - DOCUMENT ME!

positionReceived

public void positionReceived(IPosition pos)
DOCUMENT ME!

Specified by:
positionReceived in interface IGPSlistener
Parameters:
pos - DOCUMENT ME!