Class SparseImmutableTable<R,​C,​V>

  • All Implemented Interfaces:
    Table<R,​C,​V>, java.io.Serializable

    @GwtCompatible
    final class SparseImmutableTable<R,​C,​V>
    extends RegularImmutableTable<R,​C,​V>
    A RegularImmutableTable optimized for sparse data.
    • Field Detail

      • EMPTY

        static final ImmutableTable<java.lang.Object,​java.lang.Object,​java.lang.Object> EMPTY
      • cellRowIndices

        private final int[] cellRowIndices
      • cellColumnInRowIndices

        private final int[] cellColumnInRowIndices
    • Method Detail

      • columnMap

        public ImmutableMap<C,​java.util.Map<R,​V>> columnMap()
        Description copied from class: ImmutableTable
        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 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.

        Specified by:
        columnMap in interface Table<R,​C,​V>
        Specified by:
        columnMap in class ImmutableTable<R,​C,​V>
        Returns:
        a map view from each column key to a secondary map from row keys to values
      • rowMap

        public ImmutableMap<R,​java.util.Map<C,​V>> rowMap()
        Description copied from class: ImmutableTable
        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 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.

        Specified by:
        rowMap in interface Table<R,​C,​V>
        Specified by:
        rowMap in class ImmutableTable<R,​C,​V>
        Returns:
        a map view from each row key to a secondary map from column keys to values
      • size

        public int size()
        Description copied from interface: Table
        Returns the number of row key / column key / value mappings in the table.