org.freecompany.brimstone.main

Class Formatter

public class Formatter extends Object

Field Summary
protected longcurrent
protected static intlength
protected Stringname
protected booleanshowCurrent
protected booleanshowTotal
protected PrintStreamstream
protected static String[]SUFFIXES
protected longtotal
Constructor Summary
Formatter(String name, PrintStream stream)
If stream is null then we use system output, but don't provide realtime updates as certain applications (Ant) hijack System#out and provide one that does not handle carriage returns gracefully.
Method Summary
voidfinish()
protected Stringformat(float number, int count)
protected Stringformat()
voidread(int read)
voidsetTotal(long total)
voidshowCurrent(boolean showCurrent)
voidshowTotal(boolean showTotal)

Field Detail

current

protected long current

length

protected static final int length

name

protected String name

showCurrent

protected boolean showCurrent

showTotal

protected boolean showTotal

stream

protected final PrintStream stream

SUFFIXES

protected static final String[] SUFFIXES

total

protected long total

Constructor Detail

Formatter

public Formatter(String name, PrintStream stream)
If stream is null then we use system output, but don't provide realtime updates as certain applications (Ant) hijack System#out and provide one that does not handle carriage returns gracefully.

Method Detail

finish

public void finish()

format

protected String format(float number, int count)

format

protected String format()

read

public void read(int read)

setTotal

public void setTotal(long total)

showCurrent

public void showCurrent(boolean showCurrent)

showTotal

public void showTotal(boolean showTotal)