Package org.openscience.cdk.tools
Class FormatStringBuffer
java.lang.Object
org.openscience.cdk.tools.FormatStringBuffer
A class for formatting output similar to the C
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.
- Version:
- 1.7
- Author:
- Antti S. Brax (asb@iki.fi, base implementation), Fred Long (flong(AT)skcc.org, implemented 'e', 'E' and 'g')
- Source code:
- main
- Belongs to CDK module:
- standard
- License:
- BSD
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionformat
(char ch) Format achar
.format
(double dbl) Format adouble
.format
(float flt) Format afloat
.format
(int i) Format afloat
.format
(long l) Format afloat
.Format aString
.reset()
Reset thisFormatStringBuffer
with the format string given in the constructor or last call toreset(String)
.Reset thisFormatStringBuffer
.toString()
Get the result of the formatting.
-
Constructor Details
-
FormatStringBuffer
Create a newFormatStringBuffer
.- Parameters:
format
- the format string.
-
-
Method Details
-
reset
Reset thisFormatStringBuffer
.- Parameters:
format
- the format string.
-
reset
Reset thisFormatStringBuffer
with the format string given in the constructor or last call toreset(String)
. This is automatically called aftertoString()
. -
format
Format achar
. -
format
Format afloat
. -
format
Format adouble
. -
format
Format afloat
. -
format
Format afloat
. -
format
Format aString
. -
toString
Get the result of the formatting.reset()
is automatically called from this method.
-