|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--util.TxtReport
base class for text report; comma-separated, tab-delimited or free form (space delimited)
Field Summary | |
private int |
format
format selection; default FORMAT_TAB |
static int |
FORMAT_CSV
constant passed to constructor used to select format |
static int |
FORMAT_FREE
constant passed to constructor used to select format |
static int |
FORMAT_TAB
constant passed to constructor used to select format |
protected java.lang.String[] |
header
column names |
static java.lang.String |
nl
|
protected boolean |
printHeader
|
protected java.io.PrintWriter |
printWriter
|
protected boolean |
strict
check if number of fields matches number of columnnames |
static java.lang.String |
tab
|
Constructor Summary | |
TxtReport(java.io.Writer pw)
default format is FORMAT_TAB |
|
TxtReport(java.io.Writer pw,
int format)
create TxtReport; create printwriter based on param writer to enable autoflush |
Method Summary | |
void |
close()
close underlying Writer |
int |
getFormat()
|
void |
setHeader(java.lang.String[] sa)
call before writeLine() if strict == true if header is set, first line of output is always header |
void |
writeHeader()
write header at first call |
void |
writeLine(java.lang.String line)
just write line |
void |
writeLine(java.lang.String[] fields)
write fields in selected format to printwriter |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String nl
public static final java.lang.String tab
public static int FORMAT_TAB
public static int FORMAT_CSV
public static int FORMAT_FREE
private int format
protected java.lang.String[] header
protected boolean strict
protected java.io.PrintWriter printWriter
protected boolean printHeader
Constructor Detail |
public TxtReport(java.io.Writer pw)
public TxtReport(java.io.Writer pw, int format)
Method Detail |
public void setHeader(java.lang.String[] sa)
public int getFormat()
public void writeHeader()
public void writeLine(java.lang.String line)
public void writeLine(java.lang.String[] fields)
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |