public class PrettyLinkedTableMap<R,C,V> extends LinkedHashMap<R,Map<C,V>>
LinkedHashMap that simulates a sparse table where a row key
maps to a set of columns and each column maps to a value (e.g. Map[R, ->
Map[C -> V]]). This object has pretty toString() output that is
formatted as such:
+-----------------------------------------------------------+ | Record | name | gender | joinedBy | +-----------------------------------------------------------+ | 1416242356271000 | Deary Hudson | UNSPECIFIED | EMAIL | | 1416242356407000 | Jeff Nelson | UNSPECIFIED | EMAIL | | 1416242356436000 | Morgan Debaun | UNSPECIFIED | EMAIL | +-----------------------------------------------------------+
A PrettyLinkedTableMap is suitable for displaying information about
multiple records or documents.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Method and Description |
|---|---|
static <R,C,V> PrettyLinkedTableMap<R,C,V> |
newPrettyLinkedTableMap()
Return an empty
PrettyLinkedTableMap with the default row name. |
static <R,C,V> PrettyLinkedTableMap<R,C,V> |
newPrettyLinkedTableMap(String rowName)
Return an empty
PrettyLinkedTableMap with the specified
rowName. |
V |
put(R row,
C column,
V value)
Insert
value under column in row. |
Map<C,V> |
put(R key,
Map<C,V> value)
THIS METHOD ALWAYS RETURNS
NULL. |
PrettyLinkedTableMap<R,C,V> |
setRowName(String name)
Set the rowName to
name. |
String |
toString() |
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, valuesclone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, sizeequals, hashCodecompute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, putAll, putIfAbsent, remove, remove, replace, replace, sizepublic static <R,C,V> PrettyLinkedTableMap<R,C,V> newPrettyLinkedTableMap()
PrettyLinkedTableMap with the default row name.public static <R,C,V> PrettyLinkedTableMap<R,C,V> newPrettyLinkedTableMap(String rowName)
PrettyLinkedTableMap with the specified
rowName.rowName - public V put(R row, C column, V value)
value under column in row.row - column - value - row and
column or null if one did not previously exist.public PrettyLinkedTableMap<R,C,V> setRowName(String name)
name.name -