Top Description Inners Fields Constructors Methods
com.google.common.collect

public final Class Tables

extends Object
Class Inheritance
Annotations
@GwtCompatible
@ElementTypesAreNonnullByDefault
Static Imports
com.google.common.base.Preconditions.checkArgument, .Preconditions.checkNotNull, com.google.common.collect.NullnessCasts.uncheckedCastNullableTToT

Provides static methods that involve a Table.

See the Guava User Guide article on Tables.

Authors
Jared Levy, Louis Wasserman
Since
7.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv abstract static class
pack-priv static class
private static class
private static class
pack-priv static class
private static class

Field Summary

Modifier and TypeField and Description
private static final Function<? extends Map<?, ?>, ? extends Map<?, ?>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
pack-priv static boolean
equalsImpl(Table<?, ?, ?> table, Object obj)

public static <R extends @Nullable Object, C extends @Nullable Object, V extends @Nullable Object> Table.Cell<R, C, V>
immutableCell(R
the row key to be associated with the returned cell
rowKey
,
C
the column key to be associated with the returned cell
columnKey
,
V
the value to be associated with the returned cell
value
)

Returns an immutable cell with the specified row key, column key, and value.

public static <R, C, V> Table<R, C, V>
newCustomTable(Map<R, Map<C, V>>
place to store the mapping from each row key to its corresponding column key / value map
backingMap
,
Supplier<? extends Map<C, V>>
supplier of new, empty maps that will each hold all column key / value mappings for a given row key
factory
)

Creates a table that uses the specified backing map and factory.

public static <R extends @Nullable Object, C extends @Nullable Object, V extends @Nullable Object> Table<R, C, V>

Returns:

a synchronized view of the specified table
synchronizedTable
(Table<R, C, V>
the table to be wrapped in a synchronized view
table
)

Returns a synchronized (thread-safe) table backed by the specified table.

public static <T extends @Nullable Object, R extends @Nullable Object, C extends @Nullable Object, V extends @Nullable Object, I extends Table<R, C, V>> Collector<T, ?, I>
toTable(Function<? super T, ? extends R> rowFunction, Function<? super T, ? extends C> columnFunction, Function<? super T, ? extends V> valueFunction, Supplier<I> tableSupplier)

Returns a Collector that accumulates elements into a Table created using the specified supplier, whose cells are generated by applying the provided mapping functions to the input elements.

public static <T extends @Nullable Object, R extends @Nullable Object, C extends @Nullable Object, V extends @Nullable Object, I extends Table<R, C, V>> Collector<T, ?, I>
toTable(Function<? super T, ? extends R> rowFunction, Function<? super T, ? extends C> columnFunction, Function<? super T, ? extends V> valueFunction, BinaryOperator<V> mergeFunction, Supplier<I> tableSupplier)

Returns a Collector that accumulates elements into a Table created using the specified supplier, whose cells are generated by applying the provided mapping functions to the input elements.

public static <R extends @Nullable Object, C extends @Nullable Object, V1 extends @Nullable Object, V2 extends @Nullable Object> Table<R, C, V2>
transformValues(Table<R, C, V1> fromTable, Function<? super V1, V2> function)

Returns a view of a table where each value is transformed by a function.

public static <R extends @Nullable Object, C extends @Nullable Object, V extends @Nullable Object> Table<C, R, V>
transpose(Table<R, C, V> table)

Creates a transposed view of a given table that flips its row and column keys.

public static <R extends @Nullable Object, C extends @Nullable Object, V extends @Nullable Object> RowSortedTable<R, C, V>

Returns:

an unmodifiable view of the specified table
unmodifiableRowSortedTable
(RowSortedTable<R, ? extends C, ? extends V>
the row-sorted table for which an unmodifiable view is to be returned
table
)

Returns an unmodifiable view of the specified row-sorted table.

public static <R extends @Nullable Object, C extends @Nullable Object, V extends @Nullable Object> Table<R, C, V>
unmodifiableTable(Table<? extends R, ? extends C, ? extends V> table)

Returns an unmodifiable view of the specified table.

private static <K extends @Nullable Object, V extends @Nullable Object> Function<Map<K, V>, Map<K, V>>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait