final class SparseImmutableTable<R,C,V> extends RegularImmutableTable<R,C,V>
RegularImmutableTable optimized for sparse data.ImmutableTable.Builder<R,C,V>, ImmutableTable.SerializedFormTable.Cell<R,C,V>| Modifier and Type | Field and Description |
|---|---|
private int[] |
cellColumnInRowIndices |
private int[] |
cellRowIndices |
private ImmutableMap<C,ImmutableMap<R,V>> |
columnMap |
(package private) static ImmutableTable<java.lang.Object,java.lang.Object,java.lang.Object> |
EMPTY |
private ImmutableMap<R,ImmutableMap<C,V>> |
rowMap |
| Constructor and Description |
|---|
SparseImmutableTable(ImmutableList<Table.Cell<R,C,V>> cellList,
ImmutableSet<R> rowSpace,
ImmutableSet<C> columnSpace) |
| Modifier and Type | Method and Description |
|---|---|
ImmutableMap<C,java.util.Map<R,V>> |
columnMap()
Returns a view that associates each column key with the corresponding map from row keys to
values.
|
(package private) ImmutableTable.SerializedForm |
createSerializedForm()
Creates the common serialized form for this table.
|
(package private) Table.Cell<R,C,V> |
getCell(int index) |
(package private) V |
getValue(int index) |
ImmutableMap<R,java.util.Map<C,V>> |
rowMap()
Returns a view that associates each row key with the corresponding map from column keys to
values.
|
int |
size()
Returns the number of row key / column key / value mappings in the table.
|
checkNoDuplicate, createCellSet, createValues, forCells, forCells, forOrderedComponentsbuilder, cellIterator, cellOf, cellSet, cellSpliterator, clear, column, columnKeySet, contains, containsValue, copyOf, copyOf, of, of, put, putAll, remove, row, rowKeySet, toImmutableTable, toImmutableTable, values, valuesIterator, writeReplacecontainsColumn, containsRow, equals, get, hashCode, isEmpty, toString, valuesSpliteratorstatic final ImmutableTable<java.lang.Object,java.lang.Object,java.lang.Object> EMPTY
private final ImmutableMap<R,ImmutableMap<C,V>> rowMap
private final ImmutableMap<C,ImmutableMap<R,V>> columnMap
private final int[] cellRowIndices
private final int[] cellColumnInRowIndices
SparseImmutableTable(ImmutableList<Table.Cell<R,C,V>> cellList, ImmutableSet<R> rowSpace, ImmutableSet<C> columnSpace)
public ImmutableMap<C,java.util.Map<R,V>> columnMap()
ImmutableTableput() or putAll(), or setValue() on its entries.
In contrast, the maps returned by columnMap().get() have the same behavior as those
returned by Table.column(C). Those maps may support setValue(), put(), and
putAll().
The value Map<R, V> instances in the returned map are ImmutableMap instances
as well.
public ImmutableMap<R,java.util.Map<C,V>> rowMap()
ImmutableTableput() or putAll(), or setValue() on its entries.
In contrast, the maps returned by rowMap().get() have the same behavior as those
returned by Table.row(R). Those maps may support setValue(), put(), and putAll().
The value Map<C, V> instances in the returned map are ImmutableMap instances
as well.
public int size()
TableTable.Cell<R,C,V> getCell(int index)
getCell in class RegularImmutableTable<R,C,V>ImmutableTable.SerializedForm createSerializedForm()
ImmutableTablecreateSerializedForm in class ImmutableTable<R,C,V>