gnu.mapping

Class OutPort

public class OutPort extends PrintConsumer implements Printable

An extended PrintWriter.
Field Summary
protected PrettyWriterbout
static ThreadLocationerrLocation
AbstractFormatobjectFormat
static ThreadLocationoutLocation
booleanprintReadable
protected ObjectunregisterRef
An index into the WriterManager's internal table.
Constructor Summary
protected OutPort(Writer base, PrettyWriter out, boolean autoflush)
protected OutPort(OutPort out, boolean autoflush)
protected OutPort(Writer out, boolean autoflush)
OutPort(Writer base, boolean printPretty, boolean autoflush)
OutPort(Writer base, boolean printPretty, boolean autoflush, Path path)
OutPort(OutputStream out)
OutPort(OutputStream out, Path path)
OutPort(Writer out)
OutPort(Writer base, Path path)
OutPort(Writer base, boolean autoflush, Path path)
Method Summary
voidclearBuffer()
voidclose()
static voidcloseLogFile()
protected booleancloseOnExit()
True if the port should be automatically closed on exit.
voidecho(char[] buf, int off, int len)
voidendAttribute()
No more attributes in this element.
voidendElement()
voidendLogicalBlock(String suffix)
static OutPorterrDefault()
voidfreshLine()
intgetColumnNumber()
protected static booleanisWordChar(char ch)
static OutPortopenFile(Object fname)
static OutPortoutDefault()
voidprint(int v)
voidprint(long v)
voidprint(double v)
voidprint(float v)
voidprint(String v)
voidprint(Object v)
voidprint(Consumer out)
static voidrunCleanups()
voidsetColumnNumber(int column)
static voidsetErrDefault(OutPort e)
voidsetIndentation(int amount, boolean current)
static voidsetLogFile(String name)
static voidsetOutDefault(OutPort o)
voidstartAttribute(Object attrType)
Write a attribute for the current element.
voidstartElement(Object type)
voidstartLogicalBlock(String prefix, boolean perLine, String suffix)
voidstartLogicalBlock(String prefix, String suffix, int indent)
voidwriteBreak(int kind)
voidwriteBreakFill()
voidwriteBreakLinear()
Write a new-line iff the containing section cannot be printed on one line.
voidwriteSpaceFill()
Write a new-line if needed, space otherwise.
voidwriteSpaceLinear()
voidwriteWordEnd()
Note the end of a "word".
voidwriteWordStart()
Maybe write a word-separating space.

Field Detail

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 Detail

OutPort

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

OutPort

protected OutPort(OutPort out, boolean autoflush)

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(OutputStream out)

OutPort

public OutPort(OutputStream out, Path path)

OutPort

public OutPort(Writer out)

OutPort

public OutPort(Writer base, Path path)

OutPort

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

Method Detail

clearBuffer

public void clearBuffer()

close

public void close()

closeLogFile

public static void closeLogFile()

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)

endAttribute

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

endElement

public void endElement()

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)

outDefault

public static OutPort outDefault()

print

public void print(int v)

print

public void print(long v)

print

public void print(double v)

print

public void print(float v)

print

public void print(String v)

print

public void print(Object v)

print

public void print(Consumer out)

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)

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.

startElement

public void startElement(Object type)

startLogicalBlock

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

startLogicalBlock

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

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()
Note the end of a "word". See OutPort.

writeWordStart

public void writeWordStart()
Maybe write a word-separating space. Specifically, write a space if the previous output was OutPort. Otherwise, do nothing.