public class FormatStringBuffer extends Object
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)
format
- the format string.public FormatStringBuffer reset(String format)
format
- the format string.public FormatStringBuffer reset()
public FormatStringBuffer format(char ch)
public FormatStringBuffer format(float flt)
public FormatStringBuffer format(double dbl)
public FormatStringBuffer format(int i)
public FormatStringBuffer format(long l)
public FormatStringBuffer format(String str)
Copyright © 2021. All rights reserved.