public int getCurrentProgress() { if (!subNotifications.isEmpty()) { this.progressCompletionTarget = 0; this.currentProgress.set(0); for (ViewNotification subNotification : this.subNotifications) { this.progressCompletionTarget += subNotification.progressCompletionTarget; this.currentProgress.addAndGet(subNotification.getCurrentProgress()); } } if (this.currentProgress.get() >= this.progressCompletionTarget) { setCompleted( true); // TODO send Message to listening clients in Managing class if iscompleted after // this invocation } return this.currentProgress.get(); }
public void removeSubNotifications() { for (ViewNotification subNotification : subNotifications) { subNotification.dissociateFromParent(); } return; }
public void addSubNotification(ViewNotification subNotification) { subNotification.setParentNotification(this); this.subNotifications.add(subNotification); }