private boolean runOnePass() { Iterator<Object> iterator = m_commands.iterator(); if(!iterator.hasNext()) { return true; } while(iterator.hasNext()) { Object o = iterator.next(); if(o instanceof Command) { ((Command) o).execute(); iterator.remove(); }else { IncrementalCommand command = (IncrementalCommand) o; if(!command.execute()) { iterator.remove(); } } } return false; }
public void schedule(IncrementalCommand command) { DeferredCommand.addCommand(command); }
public void schedule(IncrementalCommand command) { m_commands.add(command); }
/** * Creates a TimeSlicedCommandRepeater. * * @param timer scheduler * @param sliceSize slice size in milliseconds * @param command command to repeat */ TimeSlicedCommandRepeater(TimerService timer, int sliceSize, IncrementalCommand command) { this.timer = timer; this.sliceSize = sliceSize; this.command = command; }
/** * Creates a TimeSlicedCommandRepeater. * * @param command command to repeat */ public TimeSlicedCommandRepeater(TimerService timer, IncrementalCommand command) { this(timer, DEFAULT_TIME_SLICE_MS, command); }
/** * Creates a TimeSlicedCommandRepeater. * * @param command command to repeat */ public TimeSlicedCommandRepeater(IncrementalCommand command, Priority p) { this(new SchedulerTimerService(SchedulerInstance.get(), p), command); }
public void schedule(IncrementalCommand command);