Example usage for com.google.common.collect HashBasedTable create

List of usage examples for com.google.common.collect HashBasedTable create

Introduction

In this page you can find the example usage for com.google.common.collect HashBasedTable create.

Prototype

public static <R, C, V> HashBasedTable<R, C, V> create() 

Source Link

Document

Creates an empty HashBasedTable .

Usage

From source file:de.paleocrafter.pmfw.recipes.SimpleRecipes.java

/**
 * /*from   w ww.  ja v a2s  .co m*/
 * Creates a new instance of the SimpleRecipes class. The object given can
 * be used to create simple recipes with 1 in- and output.
 * 
 */
public SimpleRecipes() {
    recipes = HashBasedTable.create();
}

From source file:com.tjtolley.carcassonne.game.Game.java

public Game(String name, UUID id, TileDeck deck)//, List<Player> players)
{
    this.map = HashBasedTable.create();
    this.gameName = name;
    this.id = id;
    //        this.players = players;
    this.placedTiles = Lists.newArrayList();
    this.placeableLocations = Sets.newHashSet(new Position(0, 0));
    this.deck = deck;
}

From source file:org.matsim.contrib.util.random.WeightedRandomSelectionTable.java

public static <R, C, V> WeightedRandomSelectionTable<R, C, V> createWithHashBasedTable() {
    Table<R, C, WeightedRandomSelection<V>> selectionTable = HashBasedTable.create();
    return new WeightedRandomSelectionTable<R, C, V>(selectionTable);
}

From source file:fr.openwide.core.jpa.querydsl.group.GTable.java

public static <R, C, V> GTable<R, C, V, Table<R, C, V>> createLinked(QTriplet<R, C, V> expr) {
    return new GTable<R, C, V, Table<R, C, V>>(expr) {
        private static final long serialVersionUID = 1L;

        @Override/* www .j  a  va  2  s  .co  m*/
        protected Table<R, C, V> createTable() {
            return HashBasedTable.create();
        }
    };
}

From source file:com.przemo.etl.transformations.WeightedAverageTransformation.java

@Override
protected Table calculateMovingAverage(Table table, int period, String column) {
    if (this.weights == null || this.weights.length != period) {
        return null;
    }/*from ww w  .  java2  s.c o m*/
    Table t = HashBasedTable.create();
    int ix = 0;
    double s0;
    double weightsTotal = calculateTotalWeight(weights);
    int qi;
    String rc = resultingColumnName(period);
    Queue<Double> sq = new ArrayBlockingQueue(period);
    for (Object r : table.rowKeySet()) {
        sq.offer((Double) table.get(r, column));
        ix++;
        if (ix >= period) {
            qi = 0;
            s0 = 0;
            for (Double d : sq) {
                s0 += this.weights[qi] * d;
                qi++;
            }
            t.put(r, rc, s0 / weightsTotal);
            sq.poll();
        }
    }
    return t;
}

From source file:de.paleocrafter.pmfw.recipes.MultiOutputRecipes.java

/**
 * //from ww w  .  j a v a2 s  .  c om
 * Creates a new instance of the MultiInputRecipes class.
 * 
 * @param outputAmount
 *            Determines, how many ItemStacks every output of the recipe
 *            holds.
 */
public MultiOutputRecipes(int outputAmount) {
    this.outputAmount = outputAmount;

    recipes = HashBasedTable.create();
}

From source file:com.turn.sorcerer.status.impl.MemoryStatusStorage.java

public MemoryStatusStorage() {
    logger.debug("New instance of memory status storage");
    store = HashBasedTable.create();
}

From source file:org.clueminer.knn.KnnCache.java

private KnnCache() {
    cache = HashBasedTable.create();
}

From source file:de.paleocrafter.pmfw.recipes.MultiInputRecipes.java

/**
 * //from www.  j a  va2 s  . c  o m
 * Creates a new instance of the MultiInputRecipes class.
 * 
 * @param inputAmount
 *            Determines, how many ItemStacks are used in all the recipes.
 * @param shapeless
 *            Determines, whether all the recipes are shapeless.
 */
public MultiInputRecipes(int inputAmount, boolean shapeless) {
    this.inputAmount = inputAmount;
    this.shapeless = shapeless;
    recipes = HashBasedTable.create();
}

From source file:net.librec.math.structure.SymmMatrix.java

/**
 * Construct a symmetric matrix//from   w  w  w.  j av a 2 s.c  om
 *
 * @param dim matrix dimension
 */
public SymmMatrix(int dim) {
    this.dim = dim;
    data = HashBasedTable.create(); // do not specify the size here as a
    // sparse matrix
}