Package com.google.common.collect
Class AbstractTable<R,C,V>
java.lang.Object
com.google.common.collect.AbstractTable<R,C,V>
- All Implemented Interfaces:
Table<R,
C, V>
- Direct Known Subclasses:
ArrayTable
,ImmutableTable
,StandardTable
,Tables.TransformedTable
,Tables.TransposeTable
Skeletal, implementation-agnostic implementation of the
Table
interface.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
(package private) class
Nested classes/interfaces inherited from interface com.google.common.collect.Table
Table.Cell<R,
C, V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) abstract Iterator
<Table.Cell<R, C, V>> Set
<Table.Cell<R, C, V>> cellSet()
Returns a set of all row key / column key / value triplets.(package private) abstract Spliterator
<Table.Cell<R, C, V>> void
clear()
Removes all mappings from the table.Returns a set of column keys that have one or more values in the table.boolean
Returnstrue
if the table contains a mapping with the specified row and column keys.boolean
containsColumn
(Object columnKey) Returnstrue
if the table contains a mapping with the specified column.boolean
containsRow
(Object rowKey) Returnstrue
if the table contains a mapping with the specified row key.boolean
containsValue
(Object value) Returnstrue
if the table contains a mapping with the specified value.(package private) Set
<Table.Cell<R, C, V>> (package private) Collection
<V> boolean
Compares the specified object with this table for equality.Returns the value corresponding to the given row and column keys, ornull
if no such mapping exists.int
hashCode()
Returns the hash code for this table.boolean
isEmpty()
Returnstrue
if the table contains no mappings.Associates the specified value with the specified keys.void
Copies all mappings from the specified table to this table.Removes the mapping, if any, associated with the given keys.Returns a set of row keys that have one or more values in the table.toString()
Returns the string representationrowMap().toString()
.values()
Returns a collection of all values, which may contain duplicates.(package private) Spliterator
<V>
-
Field Details
-
cellSet
-
values
-
-
Constructor Details
-
AbstractTable
AbstractTable()
-
-
Method Details
-
containsRow
Description copied from interface:Table
Returnstrue
if the table contains a mapping with the specified row key.- Specified by:
containsRow
in interfaceTable<R,
C, V> - Parameters:
rowKey
- key of row to search for
-
containsColumn
Description copied from interface:Table
Returnstrue
if the table contains a mapping with the specified column.- Specified by:
containsColumn
in interfaceTable<R,
C, V> - Parameters:
columnKey
- key of column to search for
-
rowKeySet
Description copied from interface:Table
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. -
columnKeySet
Description copied from interface:Table
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.- Specified by:
columnKeySet
in interfaceTable<R,
C, V> - Returns:
- set of column keys
-
containsValue
Description copied from interface:Table
Returnstrue
if the table contains a mapping with the specified value.- Specified by:
containsValue
in interfaceTable<R,
C, V> - Parameters:
value
- value to search for
-
contains
Description copied from interface:Table
Returnstrue
if the table contains a mapping with the specified row and column keys. -
get
Description copied from interface:Table
Returns the value corresponding to the given row and column keys, ornull
if no such mapping exists. -
isEmpty
public boolean isEmpty()Description copied from interface:Table
Returnstrue
if the table contains no mappings. -
clear
public void clear()Description copied from interface:Table
Removes all mappings from the table. -
remove
Description copied from interface:Table
Removes the mapping, if any, associated with the given keys. -
put
Description copied from interface:Table
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.- Specified by:
put
in interfaceTable<R,
C, V> - Parameters:
rowKey
- row key that the value should be associated withcolumnKey
- column key that the value should be associated withvalue
- value to be associated with the specified keys- Returns:
- the value previously associated with the keys, or
null
if no mapping existed for the keys
-
putAll
Description copied from interface:Table
Copies all mappings from the specified table to this table. The effect is equivalent to callingTable.put(R, C, V)
with each row key / column key / value mapping intable
. -
cellSet
Description copied from interface:Table
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 theadd
oraddAll
methods. -
createCellSet
Set<Table.Cell<R,C, createCellSet()V>> -
cellIterator
-
cellSpliterator
-
values
Description copied from interface:Table
Returns a collection of all values, which may contain duplicates. Changes to the returned collection will update the underlying table, and vice versa. -
createValues
Collection<V> createValues() -
valuesIterator
-
valuesSpliterator
Spliterator<V> valuesSpliterator() -
equals
Description copied from interface:Table
Compares the specified object with this table for equality. Two tables are equal when their cell views, as returned byTable.cellSet()
, are equal. -
hashCode
public int hashCode()Description copied from interface:Table
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 byTable.cellSet()
. -
toString
Returns the string representationrowMap().toString()
.
-