private transient static BarClosure barClosureInstance = new BarClosure();
public void consumeIntervals(IntervalConsumer consumer) {
barClosureInstance.initialize(consumer,this);
boolean inProgress = getPercentComplete() > 0.0D;
MutableInterval bounds = null;
if (inProgress) {
bounds = new MutableInterval(getStart(),getStop());
barClosureInstance.setBounds(bounds);
}
forEachWorkingInterval(barClosureInstance,true,getEffectiveWorkCalendar());
if (inProgress) {
// barClosureInstance.initCount();
bounds.setStart(bounds.getEnd()); // shift for second half
bounds.setEnd(getEnd());
forEachWorkingInterval(barClosureInstance,true,getEffectiveWorkCalendar());
}
barClosureInstance.setBounds(null);
}