EntryDoc.Kind
Modifier and Type | Field and Description |
---|---|
private AGSpec |
_agSpec |
private java.lang.String[] |
_data |
private FormatInfo |
_formatInfo |
private EntryDoc.Kind |
_kind |
private RawData |
_rawData |
Modifier | Constructor and Description |
---|---|
private |
EntryDocImpl(java.lang.String singleValue,
AGSpec agSpec,
EntryDoc.Kind kind,
FormatInfo formatInfo,
int columnCount,
java.lang.String... values) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
copyCell(RawData src,
java.lang.String key)
Copies value for
key existing in src , into this provider; no-op if
src does not contain the key . |
java.lang.String |
copyNonEmptyCell(RawData src,
java.lang.String key)
Copies non-empty value for
key existing in src , into this provider;
no-op if src does not contain the key , or if it contains the
key but the value for that key is empty. |
static EntryDoc |
createColumnLabels(java.lang.String... values)
Creates
EntryDoc.Kind.columnLabels entry. |
static EntryDocImpl |
createData(FormatInfo formatInfo,
java.lang.String... values)
Creates regular entry with data.
|
static EntryDoc |
createGroupSubhead(AGSpec agSpec,
int columnCount)
Creates
EntryDoc.Kind.groupSubhead entry. |
static EntryDoc |
createTableName(java.lang.String name,
int columnCount)
Creates
EntryDoc.Kind.tableName entry. |
static EntryDoc |
createUnformattedData(java.lang.String... values)
Creates regular entry with data without any formatting (also, no new line character).
|
private void |
ensureValid(java.lang.String name,
AGSpec agSpec,
EntryDoc.Kind kind,
FormatInfo formatInfo,
int columnCount,
java.lang.String... values) |
AGSpec |
getAttrGroupSpec()
Returns non-null instance if this is
EntryDoc.Kind.groupSubhead , null otherwise. |
java.lang.String |
getCell(java.lang.String key)
Returns value for key, null if key does not exist or if
key is null. |
java.util.Map<java.lang.String,java.lang.String> |
getCells()
Returns potentially empty map of key/value pairs.
|
FormatInfo |
getFormatInfo()
Returns format information about the formattable cell at index
j , null if this
entry has no formattable cell, or if the formattable cell is actually not formatted. |
EntryDoc.Kind |
getKind()
Returns the kind of this entry; useful for formatting.
|
java.lang.String[] |
getValues()
Returns array of values for columns (i.e., row content).
|
boolean |
hasKey(java.lang.String key)
If true,
key is present. |
java.lang.String |
putCell(java.lang.String key,
java.lang.String value)
Adds the
value for key . |
java.lang.String |
putCellNonEmpty(java.lang.String key,
java.lang.String value)
Adds the
value for key if value is not empty. |
java.lang.String |
toCsv()
Returns a single string of comma-separated items in a row, and
Util.NL between the
rows. |
java.lang.String |
toString() |
private final java.lang.String[] _data
private final EntryDoc.Kind _kind
private final FormatInfo _formatInfo
private final RawData _rawData
private final AGSpec _agSpec
private EntryDocImpl(java.lang.String singleValue, AGSpec agSpec, EntryDoc.Kind kind, FormatInfo formatInfo, int columnCount, java.lang.String... values)
public static EntryDoc createTableName(java.lang.String name, int columnCount) throws java.lang.IllegalArgumentException
EntryDoc.Kind.tableName
entry.name
- non-null, (trimmed) non-empty name for the table.columnCount
- (positive) number of columns in the table; used to fill values with empty content
except for the first item.java.lang.IllegalArgumentException
- if name
is empty, or if columnCount
is not positive.public static EntryDoc createColumnLabels(java.lang.String... values) throws java.lang.IllegalArgumentException
EntryDoc.Kind.columnLabels
entry.values
- non-empty array of non-null values.java.lang.IllegalArgumentException
- if values
is empty.public static EntryDoc createGroupSubhead(AGSpec agSpec, int columnCount) throws java.lang.IllegalArgumentException
EntryDoc.Kind.groupSubhead
entry.agSpec
- non-null spec for the group subhead.columnCount
- (positive) number of columns in the table; used to fill values with empty content
except for the first item.java.lang.IllegalArgumentException
- if name
is empty, or if columnCount
is not positive.public static EntryDoc createUnformattedData(java.lang.String... values) throws java.lang.IllegalArgumentException
values
- non-empty array of non-null values.java.lang.IllegalArgumentException
- if values
is empty.public static EntryDocImpl createData(FormatInfo formatInfo, java.lang.String... values) throws java.lang.IllegalArgumentException
formatInfo
- when non-null, index of the values
whose content needs to preserve
formatting when printed (this corresponds to a formatted column, e.g. for
description of items).values
- non-empty array of non-null values.java.lang.IllegalArgumentException
- if values
is empty.private void ensureValid(java.lang.String name, AGSpec agSpec, EntryDoc.Kind kind, FormatInfo formatInfo, int columnCount, java.lang.String... values)
public java.lang.String toString()
toString
in class java.lang.Object
public final java.lang.String[] getValues()
EntryDoc
public EntryDoc.Kind getKind()
EntryDoc
public AGSpec getAttrGroupSpec()
EntryDoc
EntryDoc.Kind.groupSubhead
, null otherwise.getAttrGroupSpec
in interface EntryDoc
public final FormatInfo getFormatInfo()
EntryDoc
j
, null if this
entry has no formattable cell, or if the formattable cell is actually not formatted.getFormatInfo
in interface EntryDoc
public final java.lang.String toCsv()
EntryDoc
public java.lang.String putCell(java.lang.String key, java.lang.String value)
RawData
value
for key
.public java.lang.String copyCell(RawData src, java.lang.String key)
RawData
key
existing in src
, into this provider; no-op if
src
does not contain the key
.public java.lang.String copyNonEmptyCell(RawData src, java.lang.String key)
RawData
key
existing in src
, into this provider;
no-op if src
does not contain the key
, or if it contains the
key
but the value for that key is empty.copyNonEmptyCell
in interface RawData
public java.lang.String putCellNonEmpty(java.lang.String key, java.lang.String value)
RawData
value
for key
if value
is not empty.putCellNonEmpty
in interface RawData
key
- non-null, non-empty key.value
- non-null, potentially empty value for the key.public boolean hasKey(java.lang.String key)
RawData
key
is present.public java.util.Map<java.lang.String,java.lang.String> getCells()
RawData
Copyright 2009-2015 Tatjana (Tanja) Kostic