|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.common.collect.Tables
@GwtCompatible @Beta public final class Tables
Provides static methods that involve a Table
.
Method Summary | ||
---|---|---|
static
|
immutableCell(R rowKey,
C columnKey,
V value)
Returns an immutable cell with the specified row key, column key, and value. |
|
static
|
transpose(Table<R,C,V> table)
Creates a transposed view of a given table that flips its row and column keys. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static <R,C,V> Table.Cell<R,C,V> immutableCell(@Nullable R rowKey, @Nullable C columnKey, @Nullable V value)
The returned cell is serializable.
rowKey
- the row key to be associated with the returned cellcolumnKey
- the column key to be associated with the returned cellvalue
- the value to be associated with the returned cellpublic static <R,C,V> Table<C,R,V> transpose(Table<R,C,V> table)
get(columnKey, rowKey)
on the
generated table always returns the same value as calling get(rowKey, columnKey)
on the original table. Updating the original table
changes the contents of the transposed table and vice versa.
The returned table supports update operations as long as the input table
supports the analogous operation with swapped rows and columns. For
example, in a HashBasedTable
instance, rowKeySet().iterator()
supports remove()
but columnKeySet().iterator()
doesn't. With a transposed HashBasedTable
, it's the other way around.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |