Class SparseImmutableTable<R,C,V>

All Implemented Interfaces:
Table<R,C,V>, Serializable

final class SparseImmutableTable<R,C,V> extends RegularImmutableTable<R,C,V>
A RegularImmutableTable optimized for sparse data.
  • Field Details

  • Constructor Details

  • Method Details

    • columnMap

      public ImmutableMap<C,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,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.
    • getCell

      Table.Cell<R,C,V> getCell(int index)
      Specified by:
      getCell in class RegularImmutableTable<R,C,V>
    • getValue

      V getValue(int index)
      Specified by:
      getValue in class RegularImmutableTable<R,C,V>
    • writeReplace

      Object writeReplace()
      Specified by:
      writeReplace in class RegularImmutableTable<R,C,V>