@GwtCompatible @Immutable final class SparseImmutableTable<R,C,V> extends RegularImmutableTable<R,C,V>
RegularImmutableTable optimized for sparse data.ImmutableTable.Builder<R,C,V>Table.Cell<R,C,V>| Modifier and Type | Field and Description |
|---|---|
private ImmutableMap<C,java.util.Map<R,V>> |
columnMap |
private int[] |
iterationOrderColumn |
private int[] |
iterationOrderRow |
private ImmutableMap<R,java.util.Map<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) 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.
|
createCellSet, createValues, forCells, forCellsbuilder, cellIterator, cellOf, cellSet, clear, column, columnKeySet, contains, containsValue, copyOf, of, of, put, putAll, remove, row, rowKeySet, values, valuesIteratorcontainsColumn, containsRow, equals, get, hashCode, isEmpty, toStringprivate final ImmutableMap<R,java.util.Map<C,V>> rowMap
private final ImmutableMap<C,java.util.Map<R,V>> columnMap
private final int[] iterationOrderRow
private final int[] iterationOrderColumn
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>