final class DenseImmutableTable<R,C,V> extends RegularImmutableTable<R,C,V>
RegularImmutableTable optimized for dense data.| Modifier and Type | Class and Description |
|---|---|
private class |
DenseImmutableTable.Column |
private class |
DenseImmutableTable.ColumnMap |
private static class |
DenseImmutableTable.ImmutableArrayMap<K,V>
An immutable map implementation backed by an indexed nullable array.
|
private class |
DenseImmutableTable.Row |
private class |
DenseImmutableTable.RowMap |
ImmutableTable.Builder<R,C,V>, ImmutableTable.SerializedFormTable.Cell<R,C,V>| Modifier and Type | Field and Description |
|---|---|
private int[] |
cellColumnIndices |
private int[] |
cellRowIndices |
private int[] |
columnCounts |
private ImmutableMap<C,java.lang.Integer> |
columnKeyToIndex |
private ImmutableMap<C,ImmutableMap<R,V>> |
columnMap |
private int[] |
rowCounts |
private ImmutableMap<R,java.lang.Integer> |
rowKeyToIndex |
private ImmutableMap<R,ImmutableMap<C,V>> |
rowMap |
private V[][] |
values |
| Constructor and Description |
|---|
DenseImmutableTable(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.
|
V |
get(java.lang.Object rowKey,
java.lang.Object columnKey)
Returns the value corresponding to the given row and column keys, or
null if no such
mapping exists. |
(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, hashCode, isEmpty, toString, valuesSpliteratorprivate final ImmutableMap<R,java.lang.Integer> rowKeyToIndex
private final ImmutableMap<C,java.lang.Integer> columnKeyToIndex
private final ImmutableMap<R,ImmutableMap<C,V>> rowMap
private final ImmutableMap<C,ImmutableMap<R,V>> columnMap
private final int[] rowCounts
private final int[] columnCounts
private final V[][] values
private final int[] cellRowIndices
private final int[] cellColumnIndices
DenseImmutableTable(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.
@CheckForNull public V get(@CheckForNull java.lang.Object rowKey, @CheckForNull java.lang.Object columnKey)
Tablenull if no such
mapping exists.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>