/** * Formats a seconds time value into a brief representation, such as <code>37 minutes</code>. * Unicode characters are used to represent 1/4, 1/2 and 3/4 fractions. * * @param seconds * the number of seconds time value. * * @return * a representation of the time. */ public String formatTime(long seconds) { return formatTime(seconds, true); }
/** * Formats a seconds time value into a brief representation, such as <code>37 minutes</code>. * Unicode characters are used to represent 1/4, 1/2 and 3/4 fractions. * * @param seconds * the number of seconds time value. * * @return * a representation of the time. */ public String formatTime(long seconds) { return formatTime(seconds, true); }
private String formatTransferDetails(ThreadWatcher watcher) { String detailsText = ""; long bytesPerSecond = watcher.getBytesPerSecond(); detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { if (detailsText.trim().length() > 0) { detailsText += " - "; } long secondsRemaining = watcher.getTimeRemaining(); detailsText += "ETA: " + timeFormatter.formatTime(secondsRemaining, false); } return detailsText; }
private String formatTransferDetails(ThreadWatcher watcher) { String detailsText = ""; long bytesPerSecond = watcher.getBytesPerSecond(); detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { if (detailsText.trim().length() > 0) { detailsText += " - "; } long secondsRemaining = watcher.getTimeRemaining(); detailsText += "ETA: " + timeFormatter.formatTime(secondsRemaining, false); } return detailsText; }
private String formatTransferDetails(ThreadWatcher watcher) { long bytesPerSecond = watcher.getBytesPerSecond(); String detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { long secondsRemaining = watcher.getTimeRemaining(); detailsText += " - Time remaining: " + timeFormatterTerse.formatTime(secondsRemaining); } return detailsText; }
private String formatTransferDetails(ThreadWatcher watcher) { long bytesPerSecond = watcher.getBytesPerSecond(); String detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { long secondsRemaining = watcher.getTimeRemaining(); detailsText += " - Time remaining: " + timeFormatter.formatTime(secondsRemaining); } return detailsText; }
private String formatTransferDetails(ThreadWatcher watcher) { long bytesPerSecond = watcher.getBytesPerSecond(); String detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { long secondsRemaining = watcher.getTimeRemaining(); detailsText += " - Time remaining: " + timeFormatter.formatTime(secondsRemaining); } return detailsText; }
private String formatTransferDetails(ThreadWatcher watcher) { long bytesPerSecond = watcher.getBytesPerSecond(); String detailsText = byteFormatter.formatByteSize(bytesPerSecond) + "/s"; if (watcher.isTimeRemainingAvailable()) { long secondsRemaining = watcher.getTimeRemaining(); detailsText += " - Time remaining: " + timeFormatterTerse.formatTime(secondsRemaining); } return detailsText; }
private String formatBytesProgressWatcherDetails(BytesProgressWatcher watcher, boolean includeBytes) { long secondsRemaining = watcher.getRemainingTime(); String detailsText = (includeBytes ? byteFormatter.formatByteSize(watcher.getBytesTransferred()) + " of " + byteFormatter.formatByteSize(watcher.getBytesToTransfer()) + " - " : "") + "Time remaining: " + timeFormatterTerse.formatTime(secondsRemaining); return detailsText; }
private String formatBytesProgressWatcherDetails(BytesProgressWatcher watcher, boolean includeBytes) { long secondsRemaining = watcher.getRemainingTime(); String detailsText = (includeBytes ? byteFormatter.formatByteSize(watcher.getBytesTransferred()) + " of " + byteFormatter.formatByteSize(watcher.getBytesToTransfer()) + " - " : "") + "Time remaining: " + timeFormatter.formatTime(secondsRemaining); return detailsText; }
private String formatBytesProgressWatcherDetails(BytesProgressWatcher watcher, boolean includeBytes) { long secondsRemaining = watcher.getRemainingTime(); String detailsText = (includeBytes ? byteFormatter.formatByteSize(watcher.getBytesTransferred()) + " of " + byteFormatter.formatByteSize(watcher.getBytesToTransfer()) + " - " : "") + "Time remaining: " + timeFormatter.formatTime(secondsRemaining); return detailsText; }
private String formatBytesProgressWatcherDetails(BytesProgressWatcher watcher, boolean includeBytes) { long secondsRemaining = watcher.getRemainingTime(); String detailsText = (includeBytes ? byteFormatter.formatByteSize(watcher.getBytesTransferred()) + " of " + byteFormatter.formatByteSize(watcher.getBytesToTransfer()) + " - " : "") + "Time remaining: " + timeFormatterTerse.formatTime(secondsRemaining); return detailsText; }
transferDetailsText += " - "; transferDetailsText += "Time remaining: " + timeFormatter.formatTime(secondsRemaining);
transferDetailsText += " - "; transferDetailsText += "Time remaining: " + timeFormatter.formatTime(secondsRemaining);
+ " (" + byteFormatterTerse.formatByteSize(watcher.getBytesPerSecond()) + "/s, " + timeFormatterTerse.formatTime(watcher.getTimeRemaining()) + ")", percentage);
+ " (" + byteFormatterTerse.formatByteSize(watcher.getBytesPerSecond()) + "/s, " + timeFormatterTerse.formatTime(watcher.getTimeRemaining()) + ")", percentage);
+ " (" + byteFormatterTerse.formatByteSize(watcher.getBytesPerSecond()) + "/s, " + timeFormatterTerse.formatTime(watcher.getTimeRemaining()) + ")", percentage);
+ " (" + byteFormatterTerse.formatByteSize(watcher.getBytesPerSecond()) + "/s, " + timeFormatterTerse.formatTime(watcher.getTimeRemaining()) + ")", percentage);