public class StatisticsFormat extends TabularFormat<Statistics>
Statistics
object.
By default, newly created StatisticsFormat
instances will format statistical values
in a tabular format using spaces as the column separator. This default configuration matches
the Statistics.toString()
format.
Defined in the sis-utility
module
Format.Field
beforeFill, columnSeparator, fillCharacter, lineSeparator, omitTrailingNulls
Constructor and Description |
---|
StatisticsFormat(Locale locale,
Locale headerLocale,
TimeZone timezone)
Constructs a new format for the given numeric and header locales.
|
Modifier and Type | Method and Description |
---|---|
StringBuffer |
format(Object object,
StringBuffer toAppendTo,
FieldPosition pos)
Formats the given statistics.
|
void |
format(Statistics[] stats,
Appendable toAppendTo)
Formats the given statistics in a tabular format.
|
void |
format(Statistics stats,
Appendable toAppendTo)
Formats a localized string representation of the given statistics.
|
int |
getBorderWidth()
Returns the "width" of the border to drawn around the table, in number of lines.
|
static StatisticsFormat |
getInstance()
Returns an instance for the current system default locale.
|
static StatisticsFormat |
getInstance(Locale locale)
Returns an instance for the given locale.
|
Class<Statistics> |
getValueType()
Returns the type of objects formatted by this class.
|
boolean |
isForAllPopulation()
Returns
true if this formatter shall consider that the statistics where computed
using the totality of the populations under study. |
Statistics |
parse(CharSequence text,
ParsePosition pos)
Not yet implemented.
|
void |
setBorderWidth(int borderWidth)
Sets the "width" of the border to drawn around the table, in number of lines.
|
void |
setForAllPopulation(boolean allPopulation)
Sets whether this formatter shall consider that the statistics where computed using
the totality of the populations under study.
|
getColumnSeparatorMatcher, getColumnSeparatorPattern, getLineSeparator, setColumnSeparatorPattern, setLineSeparator
clone, createFormat, getFormat, getLocale, getTimeZone, parseObject, parseObject
format, formatToCharacterIterator
public StatisticsFormat(Locale locale, Locale headerLocale, TimeZone timezone)
Statistics
are dates.locale
- The locale to use for numbers, dates and angles formatting,
or null
for the root locale.headerLocale
- The locale for row and column headers. Usually same as locale
.timezone
- The timezone, or null
for UTC.public static StatisticsFormat getInstance()
public static StatisticsFormat getInstance(Locale locale)
locale
- The locale for which to get a StatisticsFormat
instance.public final Class<Statistics> getValueType()
getValueType
in class CompoundFormat<Statistics>
Statistics.class
public boolean isForAllPopulation()
true
if this formatter shall consider that the statistics where computed
using the totality of the populations under study. This information impacts the standard
deviation values to be formatted.true
if the statistics to format where computed using the totality of
the populations under study.Statistics.standardDeviation(boolean)
public void setForAllPopulation(boolean allPopulation)
false
.allPopulation
- true
if the statistics to format where computed
using the totality of the populations under study.Statistics.standardDeviation(boolean)
public int getBorderWidth()
public void setBorderWidth(int borderWidth)
│
,─
)║
,═
)borderWidth
- The border width, in number of lines.public Statistics parse(CharSequence text, ParsePosition pos) throws ParseException
parse
in class CompoundFormat<Statistics>
text
- The character sequence for the object to parse.pos
- The position where to start the parsing.ParseException
- Currently never thrown.public StringBuffer format(Object object, StringBuffer toAppendTo, FieldPosition pos)
format
in class CompoundFormat<Statistics>
object
- The object to format.toAppendTo
- Where to format the object.pos
- Ignored in current implementation.public void format(Statistics stats, Appendable toAppendTo) throws IOException
format
in class CompoundFormat<Statistics>
stats
- The statistics to format.toAppendTo
- Where to format the statistics.IOException
- If an error occurred while writing to the given appendable.public void format(Statistics[] stats, Appendable toAppendTo) throws IOException
stats
- The statistics to format.toAppendTo
- Where to format the statistics.IOException
- If an error occurred while writing to the given appendable.Copyright © 2010–2014 The Apache Software Foundation. All rights reserved.