/** * Given an amount of something completed so far, and a total amount, calculates how long it will take for something to complete * * @param theCompleteToDate The amount so far * @param theTotal The total (must be higher than theCompleteToDate * @return A formatted amount of time */ public String getEstimatedTimeRemaining(double theCompleteToDate, double theTotal) { double millis = getMillis(); long millisRemaining = (long) (((theTotal / theCompleteToDate) * millis) - (millis)); return formatMillis(millisRemaining); }
/** * Formats value in an appropriate format. See {@link #formatMillis(long)}} * for a description of the format * * @see #formatMillis(long) */ @Override public String toString() { return formatMillis(getMillis()); }
b.append("Before first task"); b.append(": "); b.append(formatMillis(delta)); b.append("Between"); b.append(": "); b.append(formatMillis(delta)); b.append(": "); long delta = nextTask.getMillis(); b.append(formatMillis(delta)); b.append("After last task"); b.append(": "); b.append(formatMillis(delta));
/** * Given an amount of something completed so far, and a total amount, calculates how long it will take for something to complete * * @param theCompleteToDate The amount so far * @param theTotal The total (must be higher than theCompleteToDate * @return A formatted amount of time */ public String getEstimatedTimeRemaining(double theCompleteToDate, double theTotal) { double millis = getMillis(); long millisRemaining = (long) (((theTotal / theCompleteToDate) * millis) - (millis)); return formatMillis(millisRemaining); }
/** * Formats value in an appropriate format. See {@link #formatMillis(long)}} * for a description of the format * * @see #formatMillis(long) */ @Override public String toString() { return formatMillis(getMillis()); }
b.append("Before first task"); b.append(": "); b.append(formatMillis(delta)); b.append("Between"); b.append(": "); b.append(formatMillis(delta)); b.append(": "); long delta = nextTask.getMillis(); b.append(formatMillis(delta)); b.append("After last task"); b.append(": "); b.append(formatMillis(delta));