gnu.mapping

Class OutPort

Implemented Interfaces:
Consumer, Printable
Known Direct Subclasses:
CharArrayOutPort, XMLPrinter

public class OutPort
extends PrintConsumer
implements Printable

An extended PrintWriter.

Field Summary

protected PrettyWriter
bout
static ThreadLocation
errLocation
AbstractFormat
objectFormat
static ThreadLocation
outLocation
boolean
printReadable
protected Object
unregisterRef
An index into the WriterManager's internal table.

Constructor Summary

OutPort(OutputStream out)
OutPort(OutputStream out, Path path)
OutPort(Writer out)
OutPort(Writer out, boolean autoflush)
OutPort(Writer base, boolean printPretty, boolean autoflush)
OutPort(Writer base, boolean printPretty, boolean autoflush, Path path)
OutPort(Writer base, boolean autoflush, Path path)
OutPort(Writer base, Path path)
OutPort(Writer base, PrettyWriter out, boolean autoflush)
OutPort(OutPort out, boolean autoflush)

Method Summary

void
clearBuffer()
void
close()
static void
closeLogFile()
protected boolean
closeOnExit()
True if the port should be automatically closed on exit.
void
echo(char[] buf, int off, int len)
void
endAttribute()
No more attributes in this element.
void
endElement()
void
endLogicalBlock(String suffix)
static OutPort
errDefault()
void
freshLine()
int
getColumnNumber()
protected static boolean
isWordChar(char ch)
static OutPort
openFile(Object fname)
static OutPort
outDefault()
void
print(Object v)
void
print(String v)
void
print(double v)
void
print(float v)
void
print(Consumer out)
void
print(int v)
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
startAttribute(Object attrType)
Write a attribute for the current element.
void
startElement(Object type)
void
startLogicalBlock(String prefix, String suffix, int indent)
void
startLogicalBlock(String prefix, boolean perLine, String suffix)
void
writeBreak(int kind)
void
writeBreakFill()
void
writeBreakLinear()
Write a new-line iff the containing section cannot be printed on one line.
void
writeSpaceFill()
Write a new-line if needed, space otherwise.
void
writeSpaceLinear()
void
writeWordEnd()
Note the end of a "word".
void
writeWordStart()
Maybe write a word-separating space.

Methods inherited from class gnu.lists.PrintConsumer

endAttribute, endDocument, endElement, endNumber, ignoring, startAttribute, startDocument, startElement, startNumber, write, writeBoolean, writeDouble, writeFloat, writeInt, writeLong, writeObject

Field Details

bout

protected PrettyWriter bout

errLocation

public static final ThreadLocation errLocation

objectFormat

public AbstractFormat objectFormat

outLocation

public static final ThreadLocation outLocation

printReadable

public boolean printReadable

unregisterRef

protected Object unregisterRef
An index into the WriterManager's internal table. The value zero means it is unregistered.

Constructor Details

OutPort

public OutPort(OutputStream out)

OutPort

public OutPort(OutputStream out,
               Path path)

OutPort

public OutPort(Writer out)

OutPort

protected OutPort(Writer out,
                  boolean autoflush)

OutPort

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

OutPort

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

OutPort

public OutPort(Writer base,
               boolean autoflush,
               Path path)

OutPort

public OutPort(Writer base,
               Path path)

OutPort

protected OutPort(Writer base,
                  PrettyWriter out,
                  boolean autoflush)

OutPort

protected OutPort(OutPort out,
                  boolean autoflush)

Method Details

clearBuffer

public void clearBuffer()

close

public void close()

closeLogFile

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

closeOnExit

protected boolean closeOnExit()
True if the port should be automatically closed on exit. (If so, it will be registered by WriterManager.

echo

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

endAttribute

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

endElement

public void endElement()
Specified by:
endElement in interface Consumer
Overrides:
endElement 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(Object fname)
            throws java.io.IOException

outDefault

public static OutPort outDefault()

print

public void print(Object v)

print

public void print(String v)

print

public void print(double v)

print

public void print(float v)

print

public void print(Consumer out)
Specified by:
print in interface Printable

print

public void print(int v)

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)

startAttribute

public void startAttribute(Object attrType)
Write a attribute for the current element. This is only allowed immediately after a startElement.
Specified by:
startAttribute in interface Consumer
Overrides:
startAttribute in interface PrintConsumer

startElement

public void startElement(Object type)
Specified by:
startElement in interface Consumer
Overrides:
startElement in interface PrintConsumer

startLogicalBlock

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

startLogicalBlock

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

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.

writeSpaceFill

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

writeSpaceLinear

public void writeSpaceLinear()

writeWordEnd

public void writeWordEnd()

writeWordStart

public void writeWordStart()