Package com.google.common.collect
Class SparseImmutableTable<R,C,V>
java.lang.Object
com.google.common.collect.AbstractTable<R,C,V>
com.google.common.collect.ImmutableTable<R,C,V>
com.google.common.collect.RegularImmutableTable<R,C,V>
com.google.common.collect.SparseImmutableTable<R,C,V>
- All Implemented Interfaces:
Table<R,,C, V> Serializable
A
RegularImmutableTable optimized for sparse data.-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.collect.ImmutableTable
ImmutableTable.Builder<R,C, V>, ImmutableTable.SerializedForm Nested classes/interfaces inherited from interface com.google.common.collect.Table
Table.Cell<R,C, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int[]private final int[]private final ImmutableMap<C, ImmutableMap<R, V>> (package private) static final ImmutableTable<Object, Object, Object> private final ImmutableMap<R, ImmutableMap<C, V>> -
Constructor Summary
ConstructorsConstructorDescriptionSparseImmutableTable(ImmutableList<Table.Cell<R, C, V>> cellList, ImmutableSet<R> rowSpace, ImmutableSet<C> columnSpace) -
Method Summary
Modifier and TypeMethodDescriptionImmutableMap<C, Map<R, V>> 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) VgetValue(int index) ImmutableMap<R, Map<C, V>> rowMap()Returns a view that associates each row key with the corresponding map from column keys to values.intsize()Returns the number of row key / column key / value mappings in the table.(package private) ObjectMethods inherited from class com.google.common.collect.RegularImmutableTable
checkNoDuplicate, createCellSet, createValues, forCells, forCells, forOrderedComponentsMethods inherited from class com.google.common.collect.ImmutableTable
builder, cellIterator, cellOf, cellSet, cellSpliterator, clear, column, columnKeySet, contains, containsValue, copyOf, copyOf, of, of, put, putAll, remove, row, rowKeySet, toImmutableTable, toImmutableTable, values, valuesIteratorMethods inherited from class com.google.common.collect.AbstractTable
containsColumn, containsRow, equals, get, hashCode, isEmpty, toString, valuesSpliterator
-
Field Details
-
EMPTY
-
rowMap
-
columnMap
-
cellRowIndices
private final int[] cellRowIndices -
cellColumnInRowIndices
private final int[] cellColumnInRowIndices
-
-
Constructor Details
-
SparseImmutableTable
SparseImmutableTable(ImmutableList<Table.Cell<R, C, V>> cellList, ImmutableSet<R> rowSpace, ImmutableSet<C> columnSpace)
-
-
Method Details
-
columnMap
Description copied from class:ImmutableTableReturns a view that associates each column key with the corresponding map from row keys to values. Changes to the returned map will update this table. The returned map does not supportput()orputAll(), orsetValue()on its entries.In contrast, the maps returned by
columnMap().get()have the same behavior as those returned byTable.column(C). Those maps may supportsetValue(),put(), andputAll().The value
Map<R, V>instances in the returned map areImmutableMapinstances as well. -
rowMap
Description copied from class:ImmutableTableReturns a view that associates each row key with the corresponding map from column keys to values. Changes to the returned map will update this table. The returned map does not supportput()orputAll(), orsetValue()on its entries.In contrast, the maps returned by
rowMap().get()have the same behavior as those returned byTable.row(R). Those maps may supportsetValue(),put(), andputAll().The value
Map<C, V>instances in the returned map areImmutableMapinstances as well. -
size
public int size()Description copied from interface:TableReturns the number of row key / column key / value mappings in the table. -
getCell
- Specified by:
getCellin classRegularImmutableTable<R,C, V>
-
getValue
- Specified by:
getValuein classRegularImmutableTable<R,C, V>
-
writeReplace
Object writeReplace()- Specified by:
writeReplacein classRegularImmutableTable<R,C, V>
-