public final class StringFormat extends Object
|Modifier and Type||Method and Description|
Formats a time difference into a string stating elapsed days, hours etc.
Formats paths such as file locations or URLs.
The pattern is as follows: If
size is smaller than 30,
return the last
size chars in the string (plus some dots
in front); if the
size is larger than 30: return the first
12 chars + ... + chars from the end. If it is larger than 55: the first
28 + ... + rest from the end.
str- The string to format. If
nullan empty string is returned.
size- The requested size. Negative or too small (< 3) values are treated with respect, i.e. no exception is thrown.
public static String formatElapsedTime(long timeInMS)
formatElapsedTime(3000L)will only return "3 secs").
timeInMS- The time in milliseconds, negative values will be preceded by a minus sign
KNIME GmbH, Konstanz, Germany
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.