/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<>(rowKey, columnKey, value); }
/** * Returns a newly-created immutable table. * * @throws IllegalArgumentException if duplicate key pairs were added */ public ImmutableTable<R, C, V> build() { int size = cells.size(); switch (size) { case 0: return of(); case 1: return new SingletonImmutableTable<>(Iterables.getOnlyElement(cells)); default: return RegularImmutableTable.forCells(cells, rowComparator, columnComparator); } } }
public static SingletonImmutableTable<Object, Object, Object> instantiate( SerializationStreamReader reader) throws SerializationException { Object rowKey = reader.readObject(); Object columnKey = reader.readObject(); Object value = reader.readObject(); return new SingletonImmutableTable<>(rowKey, columnKey, value); }
/** * Returns a newly-created immutable table. * * @throws IllegalArgumentException if duplicate key pairs were added */ public ImmutableTable<R, C, V> build() { int size = cells.size(); switch (size) { case 0: return of(); case 1: return new SingletonImmutableTable<>(Iterables.getOnlyElement(cells)); default: return RegularImmutableTable.forCells(cells, rowComparator, columnComparator); } } }
/** * Returns a newly-created immutable table. * * @throws IllegalArgumentException if duplicate key pairs were added */ public ImmutableTable<R, C, V> build() { int size = cells.size(); switch (size) { case 0: return of(); case 1: return new SingletonImmutableTable<>(Iterables.getOnlyElement(cells)); default: return RegularImmutableTable.forCells(cells, rowComparator, columnComparator); } } }
return new SingletonImmutableTable<>(rowKey, columnKey, value);
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static final <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static final <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<R, C, V>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<>(rowKey, columnKey, value); }
/** Returns an immutable table containing a single cell. */ public static <R, C, V> ImmutableTable<R, C, V> of(R rowKey, C columnKey, V value) { return new SingletonImmutableTable<>(rowKey, columnKey, value); }
/** * Returns a newly-created immutable table. * * @throws IllegalArgumentException if duplicate key pairs were added */ public ImmutableTable<R, C, V> build() { int size = cells.size(); switch (size) { case 0: return of(); case 1: return new SingletonImmutableTable<R, C, V>( Iterables.getOnlyElement(cells)); default: return RegularImmutableTable.forCells( cells, rowComparator, columnComparator); } } }
public static SingletonImmutableTable<Object, Object, Object> instantiate( SerializationStreamReader reader) throws SerializationException { Object rowKey = reader.readObject(); Object columnKey = reader.readObject(); Object value = reader.readObject(); return new SingletonImmutableTable<>(rowKey, columnKey, value); }