public class FeatureFormat extends TabularFormat<Object>
City ┌────────────┬─────────┬─────────────┬───────────┐ │ Name │ Type │ Cardinality │ Value │ ├────────────┼─────────┼─────────────┼───────────┤ │ name │ String │ [1 … 1] │ Paderborn │ │ population │ Integer │ [1 … 1] │ 143,174 │ │ twin town │ City │ [0 … ∞] │ Le Mans │ └────────────┴─────────┴─────────────┴───────────┘
Limitations:
FeatureFormat
, like most java.text.Format
subclasses, is not thread-safe.Defined in the sis-feature
module
Modifier and Type | Class and Description |
---|---|
static class |
FeatureFormat.Column
Identifies the columns to include in the table formatted by
FeatureFormat . |
Format.Field
beforeFill, columnSeparator, fillCharacter, lineSeparator, omitTrailingNulls
Constructor and Description |
---|
FeatureFormat()
Creates a new formatter for the default locale and timezone.
|
FeatureFormat(Locale locale,
TimeZone timezone)
Creates a new formatter for the given locale and timezone.
|
Modifier and Type | Method and Description |
---|---|
FeatureFormat |
clone()
Returns a clone of this format.
|
void |
format(Object object,
Appendable toAppendTo)
Formats the given object to the given stream of buffer.
|
Set<FeatureFormat.Column> |
getAllowedColumns()
Returns all columns that may be shown in the tables to format.
|
Locale |
getLocale(Locale.Category category)
Returns the locale for the given category.
|
Class<Object> |
getValueType()
Returns the type of objects formatted by this class.
|
Object |
parse(CharSequence text,
ParsePosition pos)
Not yet supported.
|
void |
setAllowedColumns(Set<FeatureFormat.Column> inclusion)
Sets all columns that may be shown in the tables to format.
|
getColumnSeparatorMatcher, getColumnSeparatorPattern, getLineSeparator, setColumnSeparatorPattern, setLineSeparator
createFormat, format, getFormat, getLocale, getTimeZone, parseObject, parseObject
format, formatToCharacterIterator
public FeatureFormat()
public final Class<Object> getValueType()
Object.class
since it is the only common parent to Feature
and FeatureType
.getValueType
in class CompoundFormat<Object>
Object.class
public Locale getLocale(Locale.Category category)
Locale.Category.FORMAT
specifies the locale to use for values.Locale.Category.DISPLAY
specifies the locale to use for labels.getLocale
in class CompoundFormat<Object>
category
- the category for which a locale is desired.null
).public Set<FeatureFormat.Column> getAllowedColumns()
public void setAllowedColumns(Set<FeatureFormat.Column> inclusion)
inclusion
- all columns that may be shown in the tables to format.public void format(Object object, Appendable toAppendTo) throws IOException
Feature
FeatureType
format
in class CompoundFormat<Object>
object
- the object to format.toAppendTo
- where to format the object.IOException
- if an error occurred while writing to the given appendable.public Object parse(CharSequence text, ParsePosition pos) throws ParseException
parse
in class CompoundFormat<Object>
text
- the character sequence for the object to parse.pos
- the position where to start the parsing.
On return, the position where the parsing stopped or where an error occurred.ParseException
- currently always thrown.public FeatureFormat clone()
clone
in class TabularFormat<Object>
Copyright © 2010–2017 The Apache Software Foundation. All rights reserved.