Example usage for com.google.common.collect Tables immutableCell

List of usage examples for com.google.common.collect Tables immutableCell

Introduction

In this page you can find the example usage for com.google.common.collect Tables immutableCell.

Prototype

public static <R, C, V> Cell<R, C, V> immutableCell(@Nullable R rowKey, @Nullable C columnKey,
        @Nullable V value) 

Source Link

Document

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

Usage

From source file:com.axemblr.provisionr.amazon.core.ImageTable.java

static Iterable<Table.Cell<String, String, String>> combineHeadersWithLinePartsAsTableCells(int index,
        Iterable<String> headers, Iterable<String> lineParts) {
    final String rowKey = "" + index;
    return transform(zip(headers, lineParts),
            new Function<Map.Entry<String, String>, Table.Cell<String, String, String>>() {
                @Override/* w ww .j av a 2s. co  m*/
                public Table.Cell<String, String, String> apply(Map.Entry<String, String> entry) {
                    return Tables.immutableCell(rowKey, entry.getKey(), entry.getValue());
                }
            });
}

From source file:org.apache.provisionr.amazon.core.ImageTable.java

static Iterable<Table.Cell<String, String, String>> combineHeadersWithLinePartsAsTableCells(int index,
        Iterable<String> headers, Iterable<String> lineParts) {
    final String rowKey = "" + index;
    return transform(zip(headers, lineParts),
            new Function<Map.Entry<String, String>, Table.Cell<String, String, String>>() {
                @Override//from  w  ww.j  av  a2s. c o  m
                public Table.Cell<String, String, String> apply(Map.Entry<String, String> entry) {
                    checkNotNull(entry, "entry is null");
                    return Tables.immutableCell(rowKey, entry.getKey(), entry.getValue());
                }
            });
}

From source file:no.ssb.jsonstat.v2.support.DatasetTableView.java

@Override
public Set<Cell<List<String>, List<String>, Number>> cellSet() {
    Set<List<List<String>>> lists = Sets.cartesianProduct(rowKeySet(), columnKeySet());
    return lists.stream().map(dimensions -> {
        return Tables.immutableCell(dimensions.get(0), dimensions.get(1),
                get(dimensions.get(0), dimensions.get(1)));
    }).collect(Collectors.toSet());
}