gnu.kawa.functions
Class DisplayFormat

java.lang.Object
  extended by java.text.Format
      extended by gnu.lists.AbstractFormat
          extended by gnu.kawa.functions.DisplayFormat
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
Print

public class DisplayFormat
extends AbstractFormat

Handle formatted output for Lisp-like languages.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.Format
java.text.Format.Field
 
Field Summary
static ThreadLocation outBase
          Fluid parameter to specify default output base for printing rationals.
static ThreadLocation outRadix
          True if we should print a radix indicator when printing rationals.
 
Constructor Summary
DisplayFormat(boolean readable, char language)
          Create a new instance.
 
Method Summary
static DisplayFormat getCommonLispFormat(boolean readable)
           
static DisplayFormat getEmacsLispFormat(boolean readable)
           
 boolean getReadableOutput()
           
static DisplayFormat getSchemeFormat(boolean readable)
           
 void writeBoolean(boolean v, Consumer out)
           
 void writeChar(int v, Consumer out)
           
 void writeList(LList value, OutPort out)
           
 void writeObject(java.lang.Object obj, Consumer out)
           
 
Methods inherited from class gnu.lists.AbstractFormat
beginGroup, endGroup, format, format, parseObject, write, writeInt, writeLong, writeObject, writeObject
 
Methods inherited from class java.text.Format
clone, format, formatToCharacterIterator, parseObject
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

outBase

public static final ThreadLocation outBase
Fluid parameter to specify default output base for printing rationals.


outRadix

public static final ThreadLocation outRadix
True if we should print a radix indicator when printing rationals. The default is no; otherwise we follow Common Lisp conventions.

Constructor Detail

DisplayFormat

public DisplayFormat(boolean readable,
                     char language)
Create a new instance.

Parameters:
readable - if output should be formatted so it could be read back in again, for example strings shoudl be quoted.
language - the programming language style to use, where 'S' is Scheme, 'C' is Common Lisp, and 'E' is Emacs Lisp.
Method Detail

getEmacsLispFormat

public static DisplayFormat getEmacsLispFormat(boolean readable)

getCommonLispFormat

public static DisplayFormat getCommonLispFormat(boolean readable)

getSchemeFormat

public static DisplayFormat getSchemeFormat(boolean readable)

getReadableOutput

public boolean getReadableOutput()

writeBoolean

public void writeBoolean(boolean v,
                         Consumer out)
Overrides:
writeBoolean in class AbstractFormat

writeChar

public void writeChar(int v,
                      Consumer out)
Overrides:
writeChar in class AbstractFormat

writeList

public void writeList(LList value,
                      OutPort out)

writeObject

public void writeObject(java.lang.Object obj,
                        Consumer out)
Specified by:
writeObject in class AbstractFormat