gnu.mapping
Class OutPort

java.lang.Object
  extended by java.io.Writer
      extended by java.io.PrintWriter
          extended by gnu.lists.PrintConsumer
              extended by gnu.mapping.OutPort
All Implemented Interfaces:
Consumer, Printable, java.io.Closeable, java.io.Flushable, java.lang.Appendable
Direct Known Subclasses:
CharArrayOutPort

public class OutPort
extends PrintConsumer
implements Printable

An extended PrintWriter.


Field Summary
static ThreadLocation errLocation
           
protected  int index
          An index into the WriterManager's internal table.
 AbstractFormat objectFormat
           
static ThreadLocation outLocation
           
protected  int prev
           
 boolean printReadable
           
protected static int WORD
           
 
Fields inherited from class java.io.PrintWriter
out
 
Fields inherited from class java.io.Writer
lock
 
Constructor Summary
OutPort(java.io.OutputStream out)
           
OutPort(java.io.OutputStream out, java.lang.String name)
           
OutPort(java.io.Writer out)
           
OutPort(java.io.Writer base, boolean printPretty, boolean autoflush)
           
OutPort(java.io.Writer base, boolean printPretty, boolean autoflush, java.lang.String name)
           
OutPort(java.io.Writer base, boolean autoflush, java.lang.String name)
           
OutPort(java.io.Writer base, java.lang.String name)
           
 
Method Summary
 void beginAttribute(java.lang.String attrName, java.lang.Object attrType)
          Write a attribute for the current group.
 void beginGroup(java.lang.String typeName, java.lang.Object type)
           
 void clearBuffer()
           
 void close()
           
static void closeLogFile()
           
 void echo(char[] buf, int off, int len)
           
 void endAttribute()
          No more attributes in this group.
 void endGroup(java.lang.String typeName)
           
 void endLogicalBlock(java.lang.String suffix)
           
static OutPort errDefault()
           
 void freshLine()
           
 int getColumnNumber()
           
protected static boolean isWordChar(char ch)
           
static OutPort openFile(java.lang.String fname)
           
static OutPort outDefault()
           
 void print(char v)
           
 void print(double v)
           
 void print(float v)
           
 void print(int v)
           
 void print(long v)
           
 void print(java.lang.Object v)
           
 void print(java.io.PrintWriter ps)
           
 void print(java.lang.String v)
           
static void runCleanups()
           
 void setColumnNumber(int column)
           
static void setErrDefault(OutPort e)
           
 void setIndentation(int amount, boolean current)
           
static void setLogFile(java.lang.String name)
           
static void setOutDefault(OutPort o)
           
 void startLogicalBlock(java.lang.String prefix, boolean perLine, java.lang.String suffix)
           
 void startLogicalBlock(java.lang.String prefix, java.lang.String suffix, int indent)
           
 void write(char[] buffer, int start, int count)
           
 void write(int c)
           
 void write(java.lang.String v)
           
 void writeBreak(int kind)
           
 void writeBreakFill()
           
 void writeBreakLinear()
          Write a new-line iff the containing section cannot be printed on one line.
 void writeChar(int i)
          Write a character value to a byte-stream.
 void writeSpaceFill()
          Write a new-line if needed, space otherwise.
 void writeSpaceLinear()
           
 
Methods inherited from class gnu.lists.PrintConsumer
append, append, append, beginDocument, endDocument, ignoring, startNumber, writeBoolean, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeObject
 
Methods inherited from class java.io.PrintWriter
checkError, flush, format, format, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

index

protected int index
An index into the WriterManager's internal table.


printReadable

public boolean printReadable

outLocation

public static final ThreadLocation outLocation

errLocation

public static final ThreadLocation errLocation

WORD

protected static final int WORD
See Also:
Constant Field Values

prev

protected int prev

objectFormat

public AbstractFormat objectFormat
Constructor Detail

OutPort

public OutPort(java.io.Writer base,
               boolean printPretty,
               boolean autoflush)

OutPort

public OutPort(java.io.Writer base,
               boolean printPretty,
               boolean autoflush,
               java.lang.String name)

OutPort

public OutPort(java.io.OutputStream out)

OutPort

public OutPort(java.io.OutputStream out,
               java.lang.String name)

OutPort

public OutPort(java.io.Writer out)

OutPort

public OutPort(java.io.Writer base,
               java.lang.String name)

OutPort

public OutPort(java.io.Writer base,
               boolean autoflush,
               java.lang.String name)
Method Detail

outDefault

public static OutPort outDefault()

setOutDefault

public static void setOutDefault(OutPort o)

errDefault

public static OutPort errDefault()

setErrDefault

public static void setErrDefault(OutPort e)

openFile

public static OutPort openFile(java.lang.String fname)
                        throws java.io.UnsupportedEncodingException,
                               java.io.FileNotFoundException
Throws:
java.io.UnsupportedEncodingException
java.io.FileNotFoundException

echo

public void echo(char[] buf,
                 int off,
                 int len)
          throws java.io.IOException
Throws:
java.io.IOException

closeLogFile

public static void closeLogFile()
                         throws java.io.IOException
Throws:
java.io.IOException

setLogFile

public static void setLogFile(java.lang.String name)
                       throws java.io.IOException
Throws:
java.io.IOException

isWordChar

protected static final boolean isWordChar(char ch)

write

public void write(int c)
Overrides:
write in class java.io.PrintWriter

write

public void write(char[] buffer,
                  int start,
                  int count)
Specified by:
write in interface Consumer
Overrides:
write in class java.io.PrintWriter

write

public void write(java.lang.String v)
Overrides:
write in class java.io.PrintWriter

writeChar

public void writeChar(int i)
Write a character value to a byte-stream. The default transation generates UTF-8 multi-bytes. We support character values above 0xFFFF for future extension.

Specified by:
writeChar in interface Consumer
Overrides:
writeChar in class PrintConsumer

print

public void print(char v)
Overrides:
print in class java.io.PrintWriter

print

public void print(int v)
Overrides:
print in class java.io.PrintWriter

print

public void print(long v)
Overrides:
print in class java.io.PrintWriter

print

public void print(double v)
Overrides:
print in class java.io.PrintWriter

print

public void print(float v)
Overrides:
print in class java.io.PrintWriter

print

public void print(java.lang.String v)
Overrides:
print in class java.io.PrintWriter

print

public void print(java.lang.Object v)
Overrides:
print in class java.io.PrintWriter

print

public void print(java.io.PrintWriter ps)
Specified by:
print in interface Printable

beginGroup

public void beginGroup(java.lang.String typeName,
                       java.lang.Object type)
Specified by:
beginGroup in interface Consumer
Overrides:
beginGroup in class PrintConsumer

endGroup

public void endGroup(java.lang.String typeName)
Specified by:
endGroup in interface Consumer
Overrides:
endGroup in class PrintConsumer

beginAttribute

public void beginAttribute(java.lang.String attrName,
                           java.lang.Object attrType)
Write a attribute for the current group. This is only allowed immediately after a beginGroup.

Specified by:
beginAttribute in interface Consumer
Overrides:
beginAttribute in class PrintConsumer

endAttribute

public void endAttribute()
No more attributes in this group.

Specified by:
endAttribute in interface Consumer
Overrides:
endAttribute in class PrintConsumer

freshLine

public void freshLine()

getColumnNumber

public int getColumnNumber()

setColumnNumber

public void setColumnNumber(int column)

clearBuffer

public void clearBuffer()

close

public void close()
Specified by:
close in interface java.io.Closeable
Overrides:
close in class java.io.PrintWriter

runCleanups

public static void runCleanups()

startLogicalBlock

public void startLogicalBlock(java.lang.String prefix,
                              boolean perLine,
                              java.lang.String suffix)

startLogicalBlock

public void startLogicalBlock(java.lang.String prefix,
                              java.lang.String suffix,
                              int indent)

endLogicalBlock

public void endLogicalBlock(java.lang.String suffix)

writeBreak

public void writeBreak(int kind)

writeSpaceLinear

public void writeSpaceLinear()

writeBreakLinear

public void writeBreakLinear()
Write a new-line iff the containing section cannot be printed on one line. Either all linear-style newlines in a logical block becomes spaces (if it all fits in a line), or none of them do.


writeSpaceFill

public void writeSpaceFill()
Write a new-line if needed, space otherwise.


writeBreakFill

public void writeBreakFill()

setIndentation

public void setIndentation(int amount,
                           boolean current)