org.millscript.millscript.tools
Class FormatPrint

java.lang.Object
  extended by org.millscript.millscript.tools.FormatPrint

public final class FormatPrint
extends java.lang.Object

This utility class provides MillScripts print, show and formatted printing functionality.


Method Summary
static void print(java.io.PrintWriter out, java.lang.String control, org.millscript.commons.util.IList<?> list)
          Format prints the specified control string to the specified writer, using the specified list of arguments.
static void print1(java.io.PrintWriter out, java.lang.Object x)
          Prints the specified object to the specified writer.
static void show(java.io.PrintWriter out, java.lang.Object x)
          Shows the specified object to the specified writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

show

public static void show(java.io.PrintWriter out,
                        java.lang.Object x)
Shows the specified object to the specified writer. Showing an object will display it in a way that is more appropriate for debugging. e.g. strings will be quoted, absent will be expanded, lists will be quoted and comma separated.

Parameters:
out - the writer to show to
x - the object to show

print

public static void print(java.io.PrintWriter out,
                         java.lang.String control,
                         org.millscript.commons.util.IList<?> list)
Format prints the specified control string to the specified writer, using the specified list of arguments. The control string is iterpreted to find percent based escape sequences, which are then formatted accordingly.
%%
Prints a single %
%p
Prints the next argument in the list
%s
Shows the next argument in the list
%x
Prints the next argument as a hexadecimal number

Parameters:
out - the writer to print to
control - the format control string
list - the list of arguments for formatting

print1

public static void print1(java.io.PrintWriter out,
                          java.lang.Object x)
Prints the specified object to the specified writer. Printing an object will display it in a way that is more appropriate for output. e.g. strings will be displayed without quoted, absent would not print anything, lists will have each item in them printed.

Parameters:
out - the writer to print to
x - the object to print


Copyright © 2001-2007 Open World Ltd. All Rights Reserved.