Class Format
- java.lang.Object
-
- org.apache.lucene.benchmark.byTask.utils.Format
-
public class Format extends Object
Formatting utilities (for reports).
-
-
Constructor Summary
Constructors Constructor Description Format()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
format(int numFracDigits, double f, String col)
static String
format(int numFracDigits, float f, String col)
Padd a number from left.static String
format(int n, String col)
Pad a number from left.static String
format(String s, String col)
Pad a string from right.static String
formatPaddLeft(String s, String col)
Pad a string from left.static String
formatPaddRight(int numFracDigits, double f, String col)
static String
formatPaddRight(int numFracDigits, float f, String col)
Pad a number from right.
-
-
-
Method Detail
-
format
public static String format(int numFracDigits, float f, String col)
Padd a number from left.- Parameters:
numFracDigits
- number of digits in fraction part - must be 0 or 1 or 2.f
- number to be formatted.col
- column name (used for deciding on length).- Returns:
- formatted string.
-
formatPaddRight
public static String formatPaddRight(int numFracDigits, float f, String col)
Pad a number from right.- Parameters:
numFracDigits
- number of digits in fraction part - must be 0 or 1 or 2.f
- number to be formatted.col
- column name (used for deciding on length).- Returns:
- formatted string.
-
format
public static String format(int n, String col)
Pad a number from left.- Parameters:
n
- number to be formatted.col
- column name (used for deciding on length).- Returns:
- formatted string.
-
format
public static String format(String s, String col)
Pad a string from right.- Parameters:
s
- string to be formatted.col
- column name (used for deciding on length).- Returns:
- formatted string.
-
-