All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----Acme.Fmt
It is apparently impossible to declare a Java method that accepts variable numbers of any type of argument. You can declare it to take Objects, but numeric variables and constants are not in fact Objects.
However, using the built-in string concatenation, it's almost as convenient to make a series of single-argument formatting routines.
Fmt can format the following types:
byte short int long float double char String Object
For each type there is a set of overloaded methods, each returning
a formatted String. There's the plain formatting version:
There's a version specifying a minimum field width:Fmt.fmt( x )
And there's a version that takes flags:Fmt.fmt( x, minWidth )
Currently available flags are:Fmt.fmt( x, minWidth, flags )
The HX and OC flags imply unsigned output.Fmt.ZF - zero-fill Fmt.LJ - left justify Fmt.HX - hexadecimal Fmt.OC - octal
For doubles and floats, there's a significant-figures parameter before the flags:
Fmt.fmt( d ) Fmt.fmt( d, minWidth ) Fmt.fmt( d, minWidth, sigFigs ) Fmt.fmt( d, minWidth, sigFigs, flags )
Fetch the software.
Fetch the entire Acme package.
public static final int ZF
public static final int LJ
public static final int HX
public static final int OC
public Fmt()
public static String fmt(byte b)fmt
public static String fmt(byte b, int minWidth)fmt
public static String fmt(byte b, int minWidth, int flags)fmt
public static String fmt(short s)fmt
public static String fmt(short s, int minWidth)fmt
public static String fmt(short s, int minWidth, int flags)fmt
public static String fmt(int i)fmt
public static String fmt(int i, int minWidth)fmt
public static String fmt(int i, int minWidth, int flags)fmt
public static String fmt(long l)fmt
public static String fmt(long l, int minWidth)fmt
public static String fmt(long l, int minWidth, int flags)fmt
public static String fmt(float f)fmt
public static String fmt(float f, int minWidth)fmt
public static String fmt(float f, int minWidth, int sigFigs)fmt
public static String fmt(float f, int minWidth, int sigFigs, int flags)fmt
public static String fmt(double d)fmt
public static String fmt(double d, int minWidth)fmt
public static String fmt(double d, int minWidth, int sigFigs)fmt
public static String fmt(double d, int minWidth, int sigFigs, int flags)fmt
public static String fmt(char c)fmt
public static String fmt(char c, int minWidth)fmt
public static String fmt(char c, int minWidth, int flags)fmt
public static String fmt(Object o)fmt
public static String fmt(Object o, int minWidth)fmt
public static String fmt(Object o, int minWidth, int flags)fmt
public static String fmt(String s)fmt
public static String fmt(String s, int minWidth)fmt
public static String fmt(String s, int minWidth, int flags)doubleToString
public static String doubleToString(double d)
The JDK 1.0.2 version of Double.toString() returns only six decimal places on some systems. In JDK 1.1 full precision is returned on all platforms.
All Packages Class Hierarchy This Package Previous Next Index
ACME Java ACME Labs