@Override public void findAndInit(Object obj) { if (nmeaSensor != null) { return; } if (obj instanceof NmeaSensor) { NmeaSensor sensor = (NmeaSensor) obj; if (sensor.isSensorType(SensorType.GPS)) { nmeaSensor = sensor; nmeaSensor.addGpsListener(this); } } }
@Override public void findAndUndo(Object obj) { if (obj == nmeaSensor) { nmeaSensor.removeGpsListener(this); } }