@GwtCompatible 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.SerializedForm
Table.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.
|
createCellSet, createValues, forCells, forCells, forOrderedComponents
builder, cellIterator, cellOf, cellSet, cellSpliterator, clear, column, columnKeySet, contains, containsValue, copyOf, of, of, put, putAll, remove, row, rowKeySet, toImmutableTable, toImmutableTable, values, valuesIterator, writeReplace
containsColumn, containsRow, equals, hashCode, isEmpty, toString, valuesSpliterator
private 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()
ImmutableTable
put()
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()
ImmutableTable
put()
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 V get(java.lang.Object rowKey, java.lang.Object columnKey)
Table
null
if no such
mapping exists.public int size()
Table
Table.Cell<R,C,V> getCell(int index)
getCell
in class RegularImmutableTable<R,C,V>
ImmutableTable.SerializedForm createSerializedForm()
ImmutableTable
createSerializedForm
in class ImmutableTable<R,C,V>