|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.lang3.text.FormattableUtils
public class FormattableUtils
Provides utilities for working with the Formattable interface.
The Formattable interface provides basic control over formatting
when using a Formatter. It is primarily concerned with numeric precision
and padding, and is not designed to allow generalised alternate formats.
| Constructor Summary | |
|---|---|
FormattableUtils()
FormattableUtils instances should NOT be constructed in
standard programming. |
|
| Method Summary | |
|---|---|
static Formatter |
append(CharSequence seq,
Formatter formatter,
int flags,
int width,
int precision)
Handles the common Formattable operations of truncate-pad-append,
with no ellipsis on precision overflow, and padding width underflow with
spaces. |
static Formatter |
append(CharSequence seq,
Formatter formatter,
int flags,
int width,
int precision,
char padChar)
Handles the common Formattable operations of truncate-pad-append,
with no ellipsis on precision overflow. |
static Formatter |
append(CharSequence seq,
Formatter formatter,
int flags,
int width,
int precision,
char padChar,
CharSequence ellipsis)
Handles the common Formattable operations of truncate-pad-append. |
static Formatter |
append(CharSequence seq,
Formatter formatter,
int flags,
int width,
int precision,
CharSequence ellipsis)
Handles the common Formattable operations of truncate-pad-append,
padding width underflow with spaces. |
static String |
toString(Formattable formattable)
Get the default formatted representation of the specified Formattable. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FormattableUtils()
FormattableUtils instances should NOT be constructed in
standard programming. Instead, the methods of the class should be invoked
statically.
This constructor is public to permit tools that require a JavaBean instance to operate.
| Method Detail |
|---|
public static String toString(Formattable formattable)
Formattable.
formattable - the instance to convert to a string, not null
public static Formatter append(CharSequence seq,
Formatter formatter,
int flags,
int width,
int precision)
Formattable operations of truncate-pad-append,
with no ellipsis on precision overflow, and padding width underflow with
spaces.
seq - the string to handle, not nullformatter - the destination formatter, not nullflags - the flags for formatting, see Formattablewidth - the width of the output, see Formattableprecision - the precision of the output, see Formattable
formatter instance, not nullpublic static Formatter append(CharSequence seq,
Formatter formatter,
int flags,
int width,
int precision,
char padChar)
Formattable operations of truncate-pad-append,
with no ellipsis on precision overflow.
seq - the string to handle, not nullformatter - the destination formatter, not nullflags - the flags for formatting, see Formattablewidth - the width of the output, see Formattableprecision - the precision of the output, see FormattablepadChar - the pad character to use
formatter instance, not nullpublic static Formatter append(CharSequence seq,
Formatter formatter,
int flags,
int width,
int precision,
CharSequence ellipsis)
Formattable operations of truncate-pad-append,
padding width underflow with spaces.
seq - the string to handle, not nullformatter - the destination formatter, not nullflags - the flags for formatting, see Formattablewidth - the width of the output, see Formattableprecision - the precision of the output, see Formattableellipsis - the ellipsis to use when precision dictates truncation, null or
empty causes a hard truncation
formatter instance, not nullpublic static Formatter append(CharSequence seq,
Formatter formatter,
int flags,
int width,
int precision,
char padChar,
CharSequence ellipsis)
Formattable operations of truncate-pad-append.
seq - the string to handle, not nullformatter - the destination formatter, not nullflags - the flags for formatting, see Formattablewidth - the width of the output, see Formattableprecision - the precision of the output, see FormattablepadChar - the pad character to useellipsis - the ellipsis to use when precision dictates truncation, null or
empty causes a hard truncation
formatter instance, not null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||