The mappings corresponding to a given row key may be viewed as a Map whose keys are
the columns. The reverse is also available, associating a column with a row key / value map. Note
that, in some implementations, data access by column key may have fewer supported operations or
worse performance than data access by row key.
The methods returning collections or maps always return views of the underlying table. Updating the table can change the contents of those collections, and updating the collections will change the table.
All methods that modify the table are optional, and the views returned by the table may or may
not be modifiable. When modification isn't supported, those methods will throw an UnsupportedOperationException.
See the Guava User Guide article on Table.
| Modifier and Type | Class and Description |
|---|---|
| public static interface |
| Modifier and Type | Method and Description |
|---|---|
| public Set | Returns: set of table cells consisting of row key / column key / value tripletsReturns a set of all row key / column key / value triplets. |
| public void | |
| public Map | Returns: the corresponding map from row keys to valueskey of column to search for in the table columnKey)Returns a view of all mappings that have the given column key. |
| public Set | Returns: set of column keysReturns a set of column keys that have one or more values in the table. |
| public Map | Returns: a map view from each column key to a secondary map from row keys to valuesReturns a view that associates each column key with the corresponding map from row keys to values. |
| public boolean | |
| public boolean | containsColumn(Object
key of column to search for columnKey)Returns |
| public boolean | containsRow(Object
key of row to search for rowKey)Returns |
| public boolean | containsValue(Object
value to search for value)Returns |
| public boolean | |
| public V | |
| public int | |
| public boolean | |
| public V | Returns: the value previously associated with the keys, ornull if no mapping existed
for the keysrow key that the value should be associated with rowKey, C column key that the value should be associated with columnKey, V value to be associated with the specified keys value)Associates the specified value with the specified keys. |
| public void | |
| public V | |
| public Map | Returns: the corresponding map from column keys to valueskey of row to search for in the table rowKey)Returns a view of all mappings that have the given row key. |
| public Set | Returns: set of row keysReturns a set of row keys that have one or more values in the table. |
| public Map | Returns: a map view from each row key to a secondary map from column keys to valuesReturns a view that associates each row key with the corresponding map from column keys to values. |
| public int | |
| public Collection | Returns: collection of valuesReturns a collection of all values, which may contain duplicates. |
| cellSet | back to summary |
|---|---|
| public Set Returns a set of all row key / column key / value triplets. Changes to the returned set will
update the underlying table, and vice versa. The cell set does not support the | |
| clear | back to summary |
|---|---|
| public void clear() Removes all mappings from the table. | |
| column | back to summary |
|---|---|
| public Map Returns a view of all mappings that have the given column key. For each row key / column key / value mapping in the table with that column key, the returned map associates the row key with the value. If no mappings in the table have the provided column key, an empty map is returned. Changes to the returned map will update the underlying table, and vice versa.
| |
| columnKeySet | back to summary |
|---|---|
| public Set Returns a set of column keys that have one or more values in the table. Changes to the set will update the underlying table, and vice versa.
| |
| columnMap | back to summary |
|---|---|
| public Map 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
In contrast, the maps returned by | |
| contains | back to summary |
|---|---|
| public boolean contains(Object rowKey, Object columnKey) Returns | |
| containsColumn | back to summary |
|---|---|
| public boolean containsColumn(Object columnKey) Returns
| |
| containsRow | back to summary |
|---|---|
| public boolean containsRow(Object rowKey) Returns
| |
| containsValue | back to summary |
|---|---|
| public boolean containsValue(Object value) Returns
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Compares the specified object with this table for equality. Two tables are equal when their
cell views, as returned by
| |
| get | back to summary |
|---|---|
| public V get(Object rowKey, Object columnKey) Returns the value corresponding to the given row and column keys, or
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Returns the hash code for this table. The hash code of a table is defined as the hash code of
its cell view, as returned by
| |
| isEmpty | back to summary |
|---|---|
| public boolean isEmpty() Returns | |
| put | back to summary |
|---|---|
| public V put(R rowKey, C columnKey, V value) Associates the specified value with the specified keys. If the table already contained a mapping for those keys, the old value is replaced with the specified value.
| |
| putAll | back to summary |
|---|---|
| public void putAll(Table<? extends R, ? extends C, ? extends V> table) Copies all mappings from the specified table to this table. The effect is equivalent to calling
| |
| remove | back to summary |
|---|---|
| public V remove(Object rowKey, Object columnKey) Removes the mapping, if any, associated with the given keys.
| |
| row | back to summary |
|---|---|
| public Map Returns a view of all mappings that have the given row key. For each row key / column key / value mapping in the table with that row key, the returned map associates the column key with the value. If no mappings in the table have the provided row key, an empty map is returned. Changes to the returned map will update the underlying table, and vice versa.
| |
| rowKeySet | back to summary |
|---|---|
| public Set Returns a set of row keys that have one or more values in the table. Changes to the set will update the underlying table, and vice versa.
| |
| rowMap | back to summary |
|---|---|
| public Map 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
In contrast, the maps returned by | |
| size | back to summary |
|---|---|
| public int size() Returns the number of row key / column key / value mappings in the table. | |
| values | back to summary |
|---|---|
| public Collection Returns a collection of all values, which may contain duplicates. Changes to the returned collection will update the underlying table, and vice versa.
| |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | |
| public C | |
| public R | |
| public V | |
| public int |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Compares the specified object with this cell for equality. Two cells are equal when they have equal row keys, column keys, and values.
| |
| getColumnKey | back to summary |
|---|---|
| public C getColumnKey() Returns the column key of this cell.
| |
| getRowKey | back to summary |
|---|---|
| public R getRowKey() Returns the row key of this cell.
| |
| getValue | back to summary |
|---|---|
| public V getValue() Returns the value of this cell.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Returns the hash code of this cell. The hash code of a table cell is equal to
| |