Sharkysoft home

lava.clib.stdio
Class Printf

java.lang.Object
  |
  +--lava.clib.stdio.Printf

public class Printf
extends java.lang.Object

Formats strings of text and data.

Details: Printf provides the versatile text- and data-formatting features of the C programming language's printf function. Printf has just one (overloaded) static method, format, which requires two parameters: a format string (i.e., formatting template), and an argument list (data which will be formatted by the template). Although this class faithfully reproduces the behavior of C's printf function, it also offers additional formatting options which are not available in the C version.

This class implements the Lava Printf for Java printf format string specification. For complete details about what this means, please refer to that document. Additional information can be found in Printf for Java.

See Also:
PrintfFormatString, Va_list, Stdio

Method Summary
static java.lang.String format(PrintfFormatString format, java.lang.Object[] args)
          Formats data and text using a precompiled format string.
static java.lang.String format(java.lang.String format)
           
static java.lang.String format(java.lang.String format, java.lang.Object[] args)
          Formats data and text using an uncompiled format string.
static java.lang.String format(java.lang.String format, Va_list args)
          Formats data and text using an uncompiled format string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

format

public static java.lang.String format(java.lang.String format,
                                      Va_list args)
Formats data and text using an uncompiled format string. The String result is returned.
Parameters:
format - the format string
args - argument list
Returns:
the formatted text
Throws:
PrintfFormatException - if the format string is invalid

format

public static java.lang.String format(java.lang.String format,
                                      java.lang.Object[] args)
Formats data and text using an uncompiled format string. The String result is returned.
Parameters:
format - the format string
args - argument list
Returns:
the formatted text
Throws:
PrintfFormatException - if the format string is invalid

format

public static java.lang.String format(java.lang.String format)

format

public static java.lang.String format(PrintfFormatString format,
                                      java.lang.Object[] args)
Formats data and text using a precompiled format string. The String result is returned.
Parameters:
format - the format string
args - argument list
Returns:
the formatted text
Throws:
PrintfFormatException - if the format string is invalid

Sharkysoft home