public class FormatStringBuffer extends Object
printf
command.
Some features provided by ANSI C-standard conformant printfs
are not supported because of language constraints.
Supported conversion specifiers are: 'c', 'd', 'e', 'E', 'f', 'g' (works like 'f'), 'i', 'o', 's', 'x' and 'X'.
Supported conversion flags are: '#', '0', '-', ' ' (a space) and '+'.
Support for conversion flag '*' is under development.
Constructor and Description |
---|
FormatStringBuffer(String format)
Create a new
FormatStringBuffer . |
Modifier and Type | Method and Description |
---|---|
FormatStringBuffer |
format(char ch)
Format a
char . |
FormatStringBuffer |
format(double dbl)
Format a
double . |
FormatStringBuffer |
format(float flt)
Format a
float . |
FormatStringBuffer |
format(int i)
Format a
float . |
FormatStringBuffer |
format(long l)
Format a
float . |
FormatStringBuffer |
format(String str)
Format a
String . |
FormatStringBuffer |
reset()
Reset this
FormatStringBuffer with the format string
given in the constructor or last call to reset(String) . |
FormatStringBuffer |
reset(String format)
Reset this
FormatStringBuffer . |
String |
toString()
Get the result of the formatting.
|
public FormatStringBuffer(String format)
FormatStringBuffer
.format
- the format string.public FormatStringBuffer reset(String format)
FormatStringBuffer
.format
- the format string.public FormatStringBuffer reset()
FormatStringBuffer
with the format string
given in the constructor or last call to reset(String)
.
This is automatically called after toString()
.public FormatStringBuffer format(char ch)
char
.public FormatStringBuffer format(float flt)
float
.public FormatStringBuffer format(double dbl)
double
.public FormatStringBuffer format(int i)
float
.public FormatStringBuffer format(long l)
float
.public FormatStringBuffer format(String str)
String
.Copyright © 2022. All rights reserved.