|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openjena.atlas.io.IndentedWriter
public class IndentedWriter
A writer that records what the current indentation level is, and uses that to insert a prefix at each line. It can also insert line numbers at the beginning of lines.
Field Summary | |
---|---|
static IndentedWriter |
stderr
Stderr wrapped in an IndentedWriter - no line numbers |
static IndentedWriter |
stdout
Stdout wrapped in an IndentedWriter - no line numbers |
Constructor Summary | |
---|---|
IndentedWriter(OutputStream outStream)
Construct a UTF8 IndentedWriter around an OutputStream |
|
IndentedWriter(OutputStream outStream,
boolean withLineNumbers)
Construct a UTF8 IndentedWriter around an OutputStream |
Method Summary | |
---|---|
boolean |
atLineStart()
|
void |
close()
|
void |
decIndent()
|
void |
decIndent(int x)
|
void |
ensureStartOfLine()
|
void |
flush()
|
int |
getCol()
|
int |
getCurrentOffset()
Position past current indent |
String |
getEndOfLineMarker()
|
int |
getIndent()
|
char |
getPadChar()
|
String |
getPadString()
|
int |
getRow()
|
int |
getUnitIndent()
|
boolean |
hasLineNumbers()
|
void |
incIndent()
|
void |
incIndent(int x)
|
boolean |
inFlatMode()
Flat mode - print without NL, for a more compact representation - depends on caller |
void |
newline()
|
void |
pad()
|
void |
pad(int col)
Pad to a given number of columns EXCLUDING the indent. |
void |
pad(int col,
boolean absoluteColumn)
Pad to a given number of columns maybe including the indent. |
void |
print(char ch)
|
void |
print(char ch,
int n)
Print a char N times |
void |
print(Object obj)
|
void |
print(String s,
int n)
Print a string N times |
void |
printf(String formatStr,
Object... args)
|
void |
println()
|
void |
println(char ch)
|
void |
println(Object obj)
|
void |
setAbsoluteIndent(int x)
|
void |
setEndOfLineMarker(String marker)
Set the marker included at end of line - set to null for "none". |
void |
setFlatMode(boolean flatMode)
|
void |
setLineNumbers(boolean lineNumbers)
|
void |
setPadChar(char ch)
|
void |
setPadString(String str)
|
void |
setUnitIndent(int x)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final IndentedWriter stdout
public static final IndentedWriter stderr
Constructor Detail |
---|
public IndentedWriter(OutputStream outStream)
public IndentedWriter(OutputStream outStream, boolean withLineNumbers)
Method Detail |
---|
public void print(Object obj)
public void printf(String formatStr, Object... args)
public void print(char ch)
public void println(Object obj)
public void println(char ch)
public void println()
public void print(String s, int n)
public void print(char ch, int n)
public void newline()
public void ensureStartOfLine()
public void close()
public void flush()
public void pad()
public void pad(int col)
col
- Column number (first column is 1).public void pad(int col, boolean absoluteColumn)
col
- Column number (first column is 1).absoluteColumn
- Whether to include the indentpublic int getRow()
public int getCol()
public int getIndent()
public int getCurrentOffset()
public boolean hasLineNumbers()
public void setLineNumbers(boolean lineNumbers)
public String getEndOfLineMarker()
public void setEndOfLineMarker(String marker)
public boolean inFlatMode()
public void setFlatMode(boolean flatMode)
public char getPadChar()
public void setPadChar(char ch)
public String getPadString()
public void setPadString(String str)
public void incIndent()
public void incIndent(int x)
public void decIndent()
public void decIndent(int x)
public void setUnitIndent(int x)
public int getUnitIndent()
public void setAbsoluteIndent(int x)
public boolean atLineStart()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |