All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class dlib.Readable_Printer

java.lang.Object
   |
   +----dlib.BaseObject
           |
           +----dlib.Readable_Printer

public class Readable_Printer
extends BaseObject
Readable_Printer is a static class which supplies the two argument version of "Print_Readably", which prints objects in a form compatible with Java source files. this class also illustrates the pain caused because Java isn't a fully extensible object environment. In a better world, we would simply define Print_Readably methods directly on the object types (including base types such as "int")


Constructor Index

 o Readable_Printer()

Method Index

 o Print_Cast_To_Type(PrintStream, String, String)
print an expression which casts a containerized primitive type (such as Integer or Boolean) to the corresponding primitive type.
 o Print_Readably(PrintStream, boolean)
 o Print_Readably(PrintStream, byte)
 o Print_Readably(PrintStream, char)
 o Print_Readably(PrintStream, double)
 o Print_Readably(PrintStream, float)
 o Print_Readably(PrintStream, int)
 o Print_Readably(PrintStream, Object)
print any object readably.
 o Print_Readably(PrintStream, Object[])
print an array or objects readably.
 o Print_Readably(PrintStream, Print_Readable)
print an object which implements the Print_Readable protocol
 o Print_Readably(PrintStream, short)
 o Print_Readably(PrintStream, String)
print a string readably.

Constructors

 o Readable_Printer
 public Readable_Printer()

Methods

 o Print_Cast_To_Type
 public static void Print_Cast_To_Type(PrintStream out,
                                       String objectname,
                                       String type)
print an expression which casts a containerized primitive type (such as Integer or Boolean) to the corresponding primitive type.

 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   Print_Readable object)
print an object which implements the Print_Readable protocol

 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   Object object)
print any object readably. An error is generated if the object doesn't implement the Print_Readable protocol or is not one of the special cases Readable_Printer explicitly handles.

 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   String tf)
print a string readably. This prints the enclosing "" and handles escaping embedded " and \ characters. It doesn't handle newlines

 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   Object arg[])
print an array or objects readably. Reading will only work in contexts where a static initializer is acceptable.

 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   boolean tf)
 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   byte tf)
 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   short tf)
 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   int tf)
 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   float tf)
 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   double tf)
 o Print_Readably
 public static void Print_Readably(PrintStream out,
                                   char tf)

All Packages  Class Hierarchy  This Package  Previous  Next  Index