public int getFinishStep() { int lastStep = 0; if (isDefined()) { for (int i = 0; i < taskQueue.size(); i++) { IMonitorableTask task = (IMonitorableTask) taskQueue.get(i); lastStep += task.getFinishStep(); } } else { lastStep += taskQueue.size(); } return lastStep; }
public int getCurrentStep() { int currentStep = 0; for (int i = 0; i < taskQueue.size(); i++) { IMonitorableTask task = (IMonitorableTask) taskQueue.get(i); if (task == currentTask) { if (isDefined()) { currentStep += currentTask.getCurrentStep(); } else { currentStep = i; } break; } else { if (isDefined()) currentStep += currentTask.getFinishStep(); } } return currentStep++; }