| 1: public class TrackingExpression extends Expression
{
|
| 2: |
| 3: private Space sp_; |
| 4: private String moTag_; |
| 5: |
| 6: public TrackingExpression Space sp, String moTag throws BadSMApiUsageException
{
|
| 7: sp_=sp; |
| 8: moTag_=moTag; |
| 9:
}
|
| 10: |
| 11: public boolean evaluate()
{
|
| 12: try
{
|
| 13: Integer moInt = (Integer)TagSpace.readTag(moTag_); |
| 14: GPSData gps = (GPSData)TagSpace.readTag(“gps”); |
| 15: if (!sp_.outside(new Location(gps.latitude, gps.longitude)) && (moInt.intValue0) )
{
|
| 16: return true; |
| 17:
}
|
| 18:
}
catch(Exception e) |
| 19: return false; |
| 20:
}
|
| 21:
}
|