gnu.mapping

Class OutPort

Implemented Interfaces:
Consumer, Printable
Known Direct Subclasses:
CharArrayOutPort

public class OutPort
extends PrintConsumer
implements Printable

An extended PrintWriter.

Field Summary

protected static int
WORD
static ThreadLocation
errLocation
protected int
index
An index into the WriterManager's internal table.
AbstractFormat
objectFormat
static ThreadLocation
outLocation
protected int
prev
boolean
printReadable

Constructor Summary

OutPort(OutputStream out)
OutPort(OutputStream out, String name)
OutPort(Writer out)
OutPort(Writer base, String name)
OutPort(Writer base, boolean autoflush, String name)
OutPort(Writer base, boolean printPretty, boolean autoflush)
OutPort(Writer base, boolean printPretty, boolean autoflush, String name)

Method Summary

void
beginAttribute(String attrName, Object attrType)
Write a attribute for the current group.
void
beginGroup(String typeName, 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(String typeName)
void
endLogicalBlock(String suffix)
static OutPort
errDefault()
void
freshLine()
int
getColumnNumber()
protected static boolean
isWordChar(char ch)
static OutPort
openFile(String fname)
static OutPort
outDefault()
void
print(Object v)
void
print(String v)
void
print(char v)
void
print(double v)
void
print(float v)
void
print(int v)
void
print(java.io.PrintWriter ps)
void
print(long v)
static void
runCleanups()
void
setColumnNumber(int column)
static void
setErrDefault(OutPort e)
void
setIndentation(int amount, boolean current)
static void
setLogFile(String name)
static void
setOutDefault(OutPort o)
void
startLogicalBlock(String prefix, String suffix, int indent)
void
startLogicalBlock(String prefix, boolean perLine, String suffix)
void
write(String v)
void
write(char[] buffer, int start, int count)
void
write(int c)
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

beginAttribute, beginDocument, beginGroup, endAttribute, endDocument, endGroup, ignoring, startNumber, writeBoolean, writeChar, writeChars, writeDouble, writeFloat, writeInt, writeLong, writeObject

Field Details

WORD

protected static final int WORD
Field Value:
-2

errLocation

public static final ThreadLocation errLocation

index

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

objectFormat

public AbstractFormat objectFormat

outLocation

public static final ThreadLocation outLocation

printReadable

public boolean printReadable

Constructor Details

OutPort

public OutPort(OutputStream out)

OutPort

public OutPort(OutputStream out,
               String name)

OutPort

public OutPort(Writer out)

OutPort

public OutPort(Writer base,
               String name)

OutPort

public OutPort(Writer base,
               boolean autoflush,
               String name)

OutPort

public OutPort(Writer base,
               boolean printPretty,
               boolean autoflush)

OutPort

public OutPort(Writer base,
               boolean printPretty,
               boolean autoflush,
               String name)

Method Details

beginAttribute

public void beginAttribute(String attrName,
                           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 interface PrintConsumer

beginGroup

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

clearBuffer

public void clearBuffer()

close

public void close()

closeLogFile

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

echo

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

endAttribute

public void endAttribute()
No more attributes in this group.
Specified by:
endAttribute in interface Consumer
Overrides:
endAttribute in interface PrintConsumer

endGroup

public void endGroup(String typeName)
Specified by:
endGroup in interface Consumer
Overrides:
endGroup in interface PrintConsumer

endLogicalBlock

public void endLogicalBlock(String suffix)

errDefault

public static OutPort errDefault()

freshLine

public void freshLine()

getColumnNumber

public int getColumnNumber()

isWordChar

protected static final boolean isWordChar(char ch)

openFile

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

outDefault

public static OutPort outDefault()

print

public void print(Object v)

print

public void print(String v)

print

public void print(char v)

print

public void print(double v)

print

public void print(float v)

print

public void print(int v)

print

public void print(java.io.PrintWriter ps)

print

public void print(long v)

runCleanups

public static void runCleanups()

setColumnNumber

public void setColumnNumber(int column)

setErrDefault

public static void setErrDefault(OutPort e)

setIndentation

public void setIndentation(int amount,
                           boolean current)

setLogFile

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

setOutDefault

public static void setOutDefault(OutPort o)

startLogicalBlock

public void startLogicalBlock(String prefix,
                              String suffix,
                              int indent)

startLogicalBlock

public void startLogicalBlock(String prefix,
                              boolean perLine,
                              String suffix)

write

public void write(String v)

write

public void write(char[] buffer,
                  int start,
                  int count)
Specified by:
write in interface Consumer

write

public void write(int c)

writeBreak

public void writeBreak(int kind)

writeBreakFill

public void writeBreakFill()

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.

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 interface PrintConsumer

writeSpaceFill

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

writeSpaceLinear

public void writeSpaceLinear()