Top Description Fields Constructors Methods
com.google.common.collect

pack-priv final Class SparseImmutableTable<R, C, V>

extends RegularImmutableTable<R, C, V>
Class Inheritance
Annotations
@GwtCompatible
@Immutable
containerOf:R, C, V
@ElementTypesAreNonnullByDefault
Static Imports
java.util.Objects.requireNonNull

A RegularImmutableTable optimized for sparse data.

Field Summary

Modifier and TypeField and Description
private final int[]
private final int[]
private final ImmutableMap<C, ImmutableMap<R, V>>
pack-priv static final ImmutableTable<Object, Object, Object>
private final ImmutableMap<R, ImmutableMap<C, V>>

Constructor Summary

AccessConstructor and Description
pack-priv
SparseImmutableTable(ImmutableList<Table.Cell<R, C, V>> cellList, ImmutableSet<R> rowSpace, ImmutableSet<C> columnSpace)

Method Summary

Modifier and TypeMethod and Description
public ImmutableMap<C, Map<R, V>>
columnMap()

Implements abstract com.google.common.collect.ImmutableTable.columnMap.

Implements com.google.common.collect.Table.columnMap.

Returns a view that associates each column key with the corresponding map from row keys to values.
pack-priv Table.Cell<R, C, V>
pack-priv V
public ImmutableMap<R, Map<C, V>>
rowMap()

Implements abstract com.google.common.collect.ImmutableTable.rowMap.

Implements com.google.common.collect.Table.rowMap.

Returns a view that associates each row key with the corresponding map from column keys to values.
public int
size()

Implements com.google.common.collect.Table.size.

Returns the number of row key / column key / value mappings in the table.
pack-priv Object
Inherited from com.google.common.collect.RegularImmutableTable:
checkNoDuplicatecreateCellSetcreateValuesforCellsforCellsforOrderedComponents

Field Detail

cellColumnInRowIndicesback to summary
private final int[] cellColumnInRowIndices
Annotations
@SuppressWarnings:Immutable
cellRowIndicesback to summary
private final int[] cellRowIndices
Annotations
@SuppressWarnings:Immutable
columnMapback to summary
private final ImmutableMap<C, ImmutableMap<R, V>> columnMap
EMPTYback to summary
pack-priv static final ImmutableTable<Object, Object, Object> EMPTY
rowMapback to summary
private final ImmutableMap<R, ImmutableMap<C, V>> rowMap

Constructor Detail

SparseImmutableTableback to summary
pack-priv SparseImmutableTable(ImmutableList<Table.Cell<R, C, V>> cellList, ImmutableSet<R> rowSpace, ImmutableSet<C> columnSpace)

Method Detail

columnMapback to summary
public ImmutableMap<C, Map<R, V>> columnMap()

Implements abstract com.google.common.collect.ImmutableTable.columnMap.

Implements com.google.common.collect.Table.columnMap.

Doc from com.google.common.collect.ImmutableTable.columnMap.

Returns 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 support put() or putAll(), or setValue() on its entries.

In contrast, the maps returned by columnMap().get() have the same behavior as those returned by column. Those maps may support setValue(), put(), and putAll().

The value Map<R, V> instances in the returned map are ImmutableMap instances as well.

Returns:ImmutableMap<C, Map<R, V>>

Doc from com.google.common.collect.Table.columnMap.

a map view from each column key to a secondary map from row keys to values

Annotations
@Override
getCellback to summary
pack-priv Table.Cell<R, C, V> getCell(int index)

Implements abstract com.google.common.collect.RegularImmutableTable.getCell.

Annotations
@Override
getValueback to summary
pack-priv V getValue(int index)

Implements abstract com.google.common.collect.RegularImmutableTable.getValue.

Annotations
@Override
rowMapback to summary
public ImmutableMap<R, Map<C, V>> rowMap()

Implements abstract com.google.common.collect.ImmutableTable.rowMap.

Implements com.google.common.collect.Table.rowMap.

Doc from com.google.common.collect.ImmutableTable.rowMap.

Returns 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 support put() or putAll(), or setValue() on its entries.

In contrast, the maps returned by rowMap().get() have the same behavior as those returned by row. Those maps may support setValue(), put(), and putAll().

The value Map<C, V> instances in the returned map are ImmutableMap instances as well.

Returns:ImmutableMap<R, Map<C, V>>

Doc from com.google.common.collect.Table.rowMap.

a map view from each row key to a secondary map from column keys to values

Annotations
@Override
sizeback to summary
public int size()

Implements com.google.common.collect.Table.size.

Doc from com.google.common.collect.Table.size.

Returns the number of row key / column key / value mappings in the table.

Annotations
@Override
writeReplaceback to summary
pack-priv Object writeReplace()

Implements abstract com.google.common.collect.RegularImmutableTable.writeReplace.

Annotations
@Override
@J2ktIncompatible
@GwtIncompatible