List of usage examples for com.google.common.collect ArrayListMultimap create
public static <K, V> ArrayListMultimap<K, V> create()
From source file:com.facebook.presto.sql.planner.assertions.ExpressionAliases.java
public ExpressionAliases() { this.map = ArrayListMultimap.create(); }
From source file:org.eclipse.xtext.util.formallang.CfgUtil.java
public <E, T> Multimap<E, E> getCallers(Cfg<E, T> cfg) { Multimap<E, E> result = ArrayListMultimap.create(); getCallers(cfg, cfg.getRoot(), result); return result; }
From source file:it.units.malelab.ege.cfggp.operator.StandardTreeCrossover.java
@Override public List<Node<T>> apply(List<Node<T>> parents, Random random) { //build maps of leaf-subtrees Node<T> child1 = new Node<>(parents.get(0)); Node<T> child2 = new Node<>(parents.get(1)); child1.propagateParentship();/*from w w w . j a v a2s . com*/ child2.propagateParentship(); Multimap<T, Node<T>> child1subtrees = ArrayListMultimap.create(); Multimap<T, Node<T>> child2subtrees = ArrayListMultimap.create(); populateMultimap(child1, child1subtrees); populateMultimap(child2, child2subtrees); //build common non-terminals List<T> nonTerminals = new ArrayList<>(); nonTerminals.addAll(child1subtrees.keySet()); nonTerminals.retainAll(child2subtrees.keySet()); if (nonTerminals.isEmpty()) { return null; } Collections.shuffle(nonTerminals, random); //iterate (just once, if successfully) on non-terminals boolean done = false; for (T chosenNonTerminal : nonTerminals) { List<Node<T>> subtrees1 = new ArrayList<>(child1subtrees.get(chosenNonTerminal)); List<Node<T>> subtrees2 = new ArrayList<>(child2subtrees.get(chosenNonTerminal)); Collections.shuffle(subtrees1, random); Collections.shuffle(subtrees2, random); for (Node<T> subtree1 : subtrees1) { for (Node<T> subtree2 : subtrees2) { if ((subtree1.getAncestors().size() + subtree2.depth() <= maxDepth) && (subtree2.getAncestors().size() + subtree1.depth() <= maxDepth)) { List<Node<T>> swappingChildren = new ArrayList<>(subtree1.getChildren()); subtree1.getChildren().clear(); subtree1.getChildren().addAll(subtree2.getChildren()); subtree2.getChildren().clear(); subtree2.getChildren().addAll(swappingChildren); done = true; break; } } if (done) { break; } } if (done) { break; } } if (!done) { return null; } //return List<Node<T>> children = new ArrayList<>(2); children.add(child1); children.add(child2); return children; }
From source file:middleware.LiveAggregate.java
public LiveAggregate() { numTransactionType = 0;/* w w w.j a va 2 s . c o m*/ transactionCounts = new double[LiveTransaction.MAX_TABLE]; totalLatencies = new double[LiveTransaction.MAX_TABLE]; latencies = ArrayListMultimap.create(); }
From source file:com.talis.storage.SubmittedItem.java
public SubmittedItem(MediaType mediaType, InputStream entity) { this.mediaType = mediaType; this.entity = entity; this.metadata = ArrayListMultimap.create(); }
From source file:org.sonar.core.issue.IssuesBySeverity.java
public IssuesBySeverity() { this.issuesBySeverity = ArrayListMultimap.create(); }
From source file:com.googlesource.gerrit.plugins.cookbook.DeployedOnIncludedInExtension.java
@Override public Multimap<String, String> getIncludedIn(String project, String commit, Collection<String> tags, Collection<String> branches) { Multimap<String, String> m = ArrayListMultimap.create(); m.put(PROD, "A"); m.put(PROD, "B"); m.put(PROD, "C"); m.put(STAGING, "X"); m.put(STAGING, "Y"); m.put(STAGING, "Z"); return m;/*from ww w. j a v a2s. c o m*/ }
From source file:cosmos.sql.call.BaseVisitor.java
public BaseVisitor() { children = ArrayListMultimap.create(); }
From source file:be.nbb.demetra.mediator.file.FileMediatorConnectionSupplier.java
private static MediatorConnection fromXml(InputStream stream) throws IOException { ArrayListMultimap<String, MediatorAlias> data = ArrayListMultimap.create(); for (MediatorAlias o : loadXml(stream)) { data.put(o.getDataSourceName(), o); }/* w w w . j a v a 2s.c o m*/ return fromMultimap(data); }
From source file:neon.core.event.TaskQueue.java
public TaskQueue() { tasks = ArrayListMultimap.create(); repeat = ArrayListMultimap.create(); }