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

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

Introduction

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

Prototype

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

Source Link

Document

Returns an unmodifiable view of the specified table.

Usage

From source file:com.github.rinde.rinsim.core.model.road.CachedGraphRoadModel.java

/**
 * @return An unmodifiable view on the cache that is kept in this model.
 *///from www  .j  a  va 2 s .co  m
public Table<Point, Point, List<Point>> getPathCache() {
    return Tables.unmodifiableTable(pathTable);
}

From source file:com.torodb.torod.core.subdocument.SplitDocument.java

SplitDocument(int id, @Nonnull DocStructure structure,
        @Nonnull Table<SubDocType, Integer, SubDocument> subDocuments,
        @Nonnull Multimap<SubDocType, DocStructure> structures) {
    this.id = id;
    this.root = structure;
    this.subDocuments = Tables.unmodifiableTable(subDocuments);
    this.structures = Multimaps.unmodifiableMultimap(structures);
}

From source file:uk.ac.york.mondo.integration.api.EffectiveMetamodelRuleset.java

/**
 * Returns an unmodifiable view of the table of inclusion rules: rows are
 * metamodel URIs, columns are type names or WILDCARD (meaning all types in
 * the metamodel) and cells are either sets of slot names or a singleton set
 * with WILDCARD (meaning "all"). An empty table means "include everything".
 *//*  w ww  .  ja  va 2 s .  c  o  m*/
public Table<String, String, ImmutableSet<String>> getInclusionRules() {
    return Tables.unmodifiableTable(inclusions);
}

From source file:uk.ac.york.mondo.integration.api.EffectiveMetamodelRuleset.java

/**
 * Returns an unmodifiable view of the table of exclusion rules: rows are
 * metamodel URIs, columns are type names and cells are either sets of slot
 * names or a singleton set with WILDCARD (meaning "all"). An empty table
 * means "exclude nothing"./* w  ww .  ja v a  2 s. co m*/
 */
public Table<String, String, ImmutableSet<String>> getExclusionRules() {
    return Tables.unmodifiableTable(exclusions);
}

From source file:org.terasoluna.gfw.common.codelist.i18n.SimpleI18nCodeList.java

/**
 * set table by rows ({@link Map}).<br>
 * <p>//  www.  j  av a2 s  .co  m
 * The key is {@link Locale} and the value is {@link Map} which represents {@link CodeList}.<br>
 * </p>
 * @param rows table by rows ({@link Map}) per locale
 */
public void setRows(Map<Locale, Map<String, String>> rows) {
    checkTable();
    Table<Locale, String, String> table = createTable();
    for (Map.Entry<Locale, Map<String, String>> e : rows.entrySet()) {
        Locale locale = e.getKey();
        Map<String, String> row = e.getValue();
        for (Map.Entry<String, String> re : row.entrySet()) {
            String value = re.getKey();
            String label = re.getValue();
            table.put(locale, value, label);
        }
    }
    this.codeListTable = Tables.unmodifiableTable(table);
}

From source file:org.terasoluna.gfw.common.codelist.i18n.SimpleI18nCodeList.java

/**
 * set table by rows ({@link CodeList})<br>
 * <p>//from w  ww . j av a2 s  .co  m
 * The key is {@link Locale} and the value is {@link CodeList}.<br>
 * </p>
 * @param rows table by rows ({@link CodeList}) per locale
 */
public void setRowsByCodeList(Map<Locale, CodeList> rows) {
    checkTable();
    Table<Locale, String, String> table = createTable();
    for (Map.Entry<Locale, CodeList> e : rows.entrySet()) {
        Locale locale = e.getKey();
        Map<String, String> row = e.getValue().asMap();
        for (Map.Entry<String, String> re : row.entrySet()) {
            String value = re.getKey();
            String label = re.getValue();
            table.put(locale, value, label);
        }
    }
    this.codeListTable = Tables.unmodifiableTable(table);
}

From source file:org.terasoluna.gfw.common.codelist.i18n.SimpleI18nCodeList.java

/**
 * set table by columns ({@link Map})<br>
 * <p>/*from  ww  w  .ja  va 2 s  .co m*/
 * The key is {@link Locale} and value is {@link Map}. <br>
 * </p>
 * @param cols table by columns ({@link Map}) per locale
 */
public void setColumns(Map<String, Map<Locale, String>> cols) {
    checkTable();
    Table<Locale, String, String> table = createTable();
    for (Map.Entry<String, Map<Locale, String>> e : cols.entrySet()) {
        String value = e.getKey();
        Map<Locale, String> col = e.getValue();
        for (Map.Entry<Locale, String> ce : col.entrySet()) {
            Locale locale = ce.getKey();
            String label = ce.getValue();
            table.put(locale, value, label);
        }
    }
    this.codeListTable = Tables.unmodifiableTable(table);
}