List of usage examples for com.google.common.collect HashBiMap create
public static <K, V> HashBiMap<K, V> create()
From source file:net.caseif.ttt.util.BiMapBuilder.java
private BiMapBuilder() { backing = HashBiMap.create(); }
From source file:qa.qcri.qnoise.internal.DataProfile.java
private void internalCreation(@NotNull List<List<String>> data, @NotNull List<String> columnNames, @NotNull List<DataType> types) { this.data = data; this.columnNames = Lists.newArrayList(); this.types = Maps.newHashMap(); this.indexes = HashBiMap.create(); for (int i = 0; i < columnNames.size(); i++) { this.columnNames.add(columnNames.get(i).trim()); this.types.put(this.columnNames.get(i), types.get(i)); this.indexes.put(this.columnNames.get(i), i); }/*from w ww.j ava 2 s . c o m*/ this.mean = Maps.newHashMap(); this.var = Maps.newHashMap(); this.max = Maps.newHashMap(); this.min = Maps.newHashMap(); this.mark = Sets.newHashSet(); }
From source file:org.apache.carbondata.processing.newflow.dictionary.InMemBiDictionary.java
/** * Constructor to create a new dictionary, dictionary key will be generated by specified generator * @param generator//from w w w . j a v a 2s .c o m */ public InMemBiDictionary(DictionaryGenerator generator) { super(generator); biMap = HashBiMap.create(); }
From source file:com.sky8the2flies.KOTH.util.board.SkyBoard.java
public SkyBoard(String title) { this.scoreboard = Bukkit.getScoreboardManager().getNewScoreboard(); this.objective = scoreboard.registerNewObjective("skyobjective", "dummy"); this.objective.setDisplaySlot(DisplaySlot.SIDEBAR); setTitle(title);//from www. j av a 2 s .c o m this.entries = HashBiMap.create(); this.teamId = 1; }
From source file:org.atlasapi.output.rdf.NaiveTypeMap.java
public NaiveTypeMap() { map = HashBiMap.create(); map.put(Encoding.class, Collections.singleton("http://uriplay.org/elements/Encoding")); map.put(Location.class, Collections.singleton("http://uriplay.org/elements/Location")); map.put(Episode.class, Collections.singleton("http://purl.org/ontology/po/Episode")); map.put(Version.class, Collections.singleton("http://purl.org/ontology/po/Version")); map.put(Broadcast.class, Collections.singleton("http://purl.org/ontology/po/Broadcast")); map.put(Brand.class, Collections.singleton("http://purl.org/ontology/po/Brand")); map.put(Item.class, Collections.singleton("http://uriplay.org/elements/Item")); map.put(Container.class, Collections.singleton("http://uriplay.org/elements/List")); map.put(Policy.class, Collections.singleton("http://uriplay.org/elements/Policy")); map.put(Person.class, Collections.singleton("http://uriplay.org/elements/Person")); map.put(Series.class, Collections.singleton("http://uriplay.org/elements/Series")); }
From source file:com.google.gitiles.doc.TocFormatter.java
void setRoot(RootNode doc) { root = doc; hasToc = null; ids = HashBiMap.create(); }
From source file:org.eclipse.tracecompass.internal.totalads.algorithms.sequencematching.NameToIDMapper.java
/** * Constructor */ public NameToIDMapper() { fNameToID = HashBiMap.create(); }
From source file:io.ecarf.core.utils.BiMapJsonDeserializer.java
@Override public BiMap<String, Integer> deserialize(JsonElement json, Type type, JsonDeserializationContext context) throws JsonParseException { BiMap<String, Integer> mapping = HashBiMap.create(); //Type[] typeParameters = ((ParameterizedType) type).getActualTypeArguments(); JsonObject object = (JsonObject) json; for (Map.Entry<String, JsonElement> entry : object.entrySet()) { int value = entry.getValue().getAsInt(); mapping.put(entry.getKey(), value); //Castors.me() // .castTo(value, // (Class) typeParameters[1])); }/*from w ww.ja va2s . c om*/ return mapping; }
From source file:de.ovgu.featureide.fm.core.constraint.analysis.Translator.java
/** * Creates a bijective mapping between the first n natural numbers and the * features present in the model./*from w w w . j av a 2s .c o m*/ * * @param fm The feature model. * @return 1-to-1 mapping of natural numbers to features. */ public static BiMap<String, Integer> buildFeatureNameMap(FeatureModel fm, UniqueId idGen) { BiMap<String, Integer> m = HashBiMap.create(); for (String f : fm.getFeatureNames()) { m.put(f, idGen.getNext()); } return m; }
From source file:de.xaniox.heavyspleef.core.extension.ExtensionRegistry.java
public ExtensionRegistry(HeavySpleef heavySpleef) { this.registeredExtensions = HashBiMap.create(); this.heavySpleef = heavySpleef; }