I have a class as follows:
private class LanePair {
public int cameraNumber;
public Nest nest1, nest2;
public LanePairStatus status = LanePairStatus.TIMER_OFF;
Timer timer = new Timer();
public LanePair(int cameraNunber, Nest nest1, Nest nest2) {
this.cameraNumber = cameraNumber;
this.nest1 = nest1;
this.nest2 = nest2;
}
public void startTimer() {
status = LanePairStatus.TIMER_ON;
timer.schedule(new TimerTask() {
public void run() {
DoAskForLaneClear(/*I want to pass this class (LanePair) here*/);
}
}, 6000 ); // 6 seconds
}
public void stopTimer() {
timer.cancel();
}
}
The thing is, I can't figure out how to do it. Any suggestions?