public class Formatter
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
DIVIDER |
protected static java.lang.String |
SUBDIVIDER |
protected static int |
WIDTH
The width (in characters) of the report output.
|
| Constructor and Description |
|---|
Formatter() |
| Modifier and Type | Method and Description |
|---|---|
static void |
center(java.lang.String s,
java.io.PrintWriter pw)
Centers the given string on the
PrintWriter |
static java.util.Vector |
formatDecimal(java.util.Collection c,
java.lang.String pattern)
Returns a collection of decimals based on the given collection but with
the doubles formatted according to the pattern.
|
static int |
maxLength(java.util.Collection strings)
Returns the length of the longest string in the collection (0 if the
collection is empty).
|
static java.util.Vector |
padLeft(java.util.Collection strings)
Returns a collection of strings based on the given collection but with
all strings padded on the left to the length of the longest one.
|
static java.util.Vector |
padLeft(java.util.Collection doubles,
java.lang.String pattern)
Returns a collection of doubles based on the given collection but with
the doubles formatted according to the pattern and all entries, both
doubles and string, padded on the left to the length of the longest one.
|
static java.lang.String |
padLeft(java.lang.String s,
int length)
Returns a string that is the given string padded on the left to the given length.
|
static java.util.Vector |
padRight(java.util.Collection strings)
Returns a collection of strings based on the given collection but with
all strings padded on the right to the length of the longest one.
|
static java.util.Vector |
padRight(java.util.Collection doubles,
java.lang.String pattern)
Returns a collection of doubles based on the given collection but with
the doubles formatted according to the pattern and all entries, both
doubles and string, padded on the right to the length of the longest one.
|
static java.lang.String |
padRight(java.lang.String s,
int length)
Returns a string that is the given string padded on the right to the given length.
|
protected static final int WIDTH
center(String, PrintWriter),
Constant Field Valuesprotected static final java.lang.String DIVIDER
protected static final java.lang.String SUBDIVIDER
public static void center(java.lang.String s,
java.io.PrintWriter pw)
PrintWriterpublic static java.util.Vector formatDecimal(java.util.Collection c,
java.lang.String pattern)
public static java.util.Vector padLeft(java.util.Collection doubles,
java.lang.String pattern)
public static java.util.Vector padRight(java.util.Collection doubles,
java.lang.String pattern)
public static java.util.Vector padLeft(java.util.Collection strings)
public static java.util.Vector padRight(java.util.Collection strings)
public static java.lang.String padLeft(java.lang.String s,
int length)
public static java.lang.String padRight(java.lang.String s,
int length)
public static int maxLength(java.util.Collection strings)
Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.