Formatting

This commit is contained in:
dev
2015-04-06 21:10:49 +00:00
parent facbe8f9a0
commit d8fbc9c170

View File

@@ -136,11 +136,11 @@ public class SimpleTimer2 {
throw new IllegalArgumentException("addEvent null"); throw new IllegalArgumentException("addEvent null");
new TimedEvent(SimpleTimer2.getInstance(), timeoutMs) { new TimedEvent(SimpleTimer2.getInstance(), timeoutMs) {
@Override @Override
public void timeReached() { public void timeReached() {
event.timeReached(); event.timeReached();
} }
}; };
} }
/** /**
@@ -157,12 +157,12 @@ public class SimpleTimer2 {
public void addPeriodicEvent(final SimpleTimer.TimedEvent event, final long timeoutMs) { public void addPeriodicEvent(final SimpleTimer.TimedEvent event, final long timeoutMs) {
new PeriodicTimedEvent(SimpleTimer2.getInstance(), timeoutMs) { new PeriodicTimedEvent(SimpleTimer2.getInstance(), timeoutMs) {
@Override @Override
public void timeReached() { public void timeReached() {
event.timeReached(); event.timeReached();
} }
}; };
} }
/** /**
* Schedule periodic event * Schedule periodic event
@@ -175,15 +175,15 @@ public class SimpleTimer2 {
* @param delay run the first iteration of this event after delay ms * @param delay run the first iteration of this event after delay ms
* @param timeoutMs run subsequent iterations of this event every timeoutMs ms * @param timeoutMs run subsequent iterations of this event every timeoutMs ms
*/ */
public void addPeriodicEvent(final SimpleTimer.TimedEvent event, final long delay, final long timeoutMs) { public void addPeriodicEvent(final SimpleTimer.TimedEvent event, final long delay, final long timeoutMs) {
new PeriodicTimedEvent(SimpleTimer2.getInstance(), delay, timeoutMs) { new PeriodicTimedEvent(SimpleTimer2.getInstance(), delay, timeoutMs) {
@Override @Override
public void timeReached() { public void timeReached() {
event.timeReached(); event.timeReached();
} }
}; };
} }
/** /**
* state of a given TimedEvent * state of a given TimedEvent
@@ -465,14 +465,14 @@ public class SimpleTimer2 {
} }
public static abstract class PeriodicTimedEvent extends TimedEvent { public static abstract class PeriodicTimedEvent extends TimedEvent {
private long _timeoutMs; private long _timeoutMs;
/** /**
* Schedule periodic event * Schedule periodic event
* *
* @param timeoutMs run subsequent iterations of this event every timeoutMs ms * @param timeoutMs run subsequent iterations of this event every timeoutMs ms
*/ */
public PeriodicTimedEvent(SimpleTimer2 pool, long timeoutMs) { public PeriodicTimedEvent(SimpleTimer2 pool, long timeoutMs) {
super(pool, timeoutMs); super(pool, timeoutMs);
_timeoutMs = timeoutMs; _timeoutMs = timeoutMs;
} }
@@ -490,8 +490,8 @@ public class SimpleTimer2 {
@Override @Override
public void run() { public void run() {
super.run(); super.run();
schedule(_timeoutMs); schedule(_timeoutMs);
} }
} }
} }