if (profile.getFragmentProfileCount() > 0) {
public String getPlanningDuration() { //Check if Planning End is known if (profile.getPlanEnd() > 0L) { return (new SimpleDurationFormat(profile.getStart(), profile.getPlanEnd())).verbose(); } //Check if any fragments have started if (profile.getFragmentProfileCount() > 0) { //Init Planning End Time long estimatedPlanEnd = Long.MAX_VALUE; //Using Screen MajorFragment as reference MajorFragmentProfile majorFrag0 = profile.getFragmentProfile(0); //Searching for earliest starting fragment for (MinorFragmentProfile fragmentWrapper : majorFrag0.getMinorFragmentProfileList()) { long minorFragmentStart = fragmentWrapper.getStartTime(); if (minorFragmentStart > 0 && minorFragmentStart < estimatedPlanEnd) { estimatedPlanEnd = minorFragmentStart; } } //Provide estimated plan time return (new SimpleDurationFormat(profile.getStart(), estimatedPlanEnd)).verbose() + ESTIMATED_LABEL; } //Unable to estimate/calculate Specific Time spent in Planning return NOT_AVAILABLE_LABEL; }