public static Currency translateBitmexCurrencyCode(String currencyIn) { Currency currencyOut = assetsMap.get(currencyIn); if (currencyOut == null) { throw new ExchangeException("Bitmex does not support the currency code " + currencyIn); } return currencyOut.getCommonlyUsedCurrency(); }
public void testMapConstructor() { /* Test with non-empty Map. */ Map<String, String> map = ImmutableMap.of( "canada", "dollar", "chile", "peso", "switzerland", "franc"); HashBiMap<String, String> bimap = HashBiMap.create(map); assertEquals("dollar", bimap.get("canada")); assertEquals("canada", bimap.inverse().get("dollar")); }
private ViewAdapter searchForViewByHandle(String handle) { synchronized (syncObject) { return map.get(handle); } }
/* package */ static ViewAdapter getViewAdapterFor(Object view) { return views.get(view); }
/** * * @param typeId * @return * @throws IllegalArgumentException if there is not type associated with the given id */ public SubDocType getSubDocType(int typeId) throws IllegalArgumentException { SubDocType type = typesById.get(typeId); if (type == null) { throw new IllegalArgumentException("There is no type registered with the id " + typeId); } return type; }
public NamedDbIndex getDbIndex(String name) { NamedDbIndex result = memory.dbNameToNamed.get(name); if (result == null) { throw new IllegalArgumentException("There is no db index called '" + name + '\''); } return result; }
public static org.knowm.xchange.Exchange getExchangeForMarket(Exchange coinTraderExchange) { org.knowm.xchange.Exchange xchangeExchange = exchangesByMarket.get(coinTraderExchange); if (xchangeExchange == null) throw new Error("Could not get XChange Exchange for Coin Trader Exchange " + coinTraderExchange); return xchangeExchange; }
private int getLineNumber(int offset) { int lineStart = findLineStartOffset(offset); Integer line = lineNumbers.get(lineStart); assert line != null : lineStart; return line; }
/* package */ ViewAdapter getNextView() { synchronized (syncObject) { String key = map.keySet().iterator().next(); return map.get(key); } }
public String getName(EntityPlayer player) { return uuidToName.get(player.getUniqueID()); }
public LinkedList<MACAddress> getFlowValues(final Integer flowId) { final LinkedList<MACAddress> macList = new LinkedList<MACAddress>(); final BigInteger dualMac = this.flowValues.get(flowId); if (dualMac != null) { final MACAddress srcMac = MACAddress.valueOf(dualMac.shiftRight(48) .longValue()); final MACAddress dstMac = MACAddress.valueOf(dualMac.longValue()); macList.add(srcMac); macList.add(dstMac); } return macList; }
public List<Email> getEmailsForAccount(EntityPlayer player) { if (uuidToName.containsKey(player.getUniqueID())) { return nameToInbox.get(uuidToName.get(player.getUniqueID())); } return new ArrayList<Email>(); }
@Override public Object call() throws Exception { JMEGraphics3DNode node = jmeGraphicsNodes.get(rootJoint); Node freezedNode = node.clone(true); zUpNode.attachChild(freezedNode); return null; } });
@Override public Object call() throws Exception { JMEGraphics3DNode node = jmeGraphicsNodes.get(rootJoint); Node freezedNode = node.clone(true); zUpNode.attachChild(freezedNode); return null; } });
public static Currency translateBitmexCurrencyCode(String currencyIn) { Currency currencyOut = assetsMap.get(currencyIn); if (currencyOut == null) { throw new ExchangeException("Bitmex does not support the currency code " + currencyIn); } return currencyOut.getCommonlyUsedCurrency(); }
public static String getCigarString(Read read) { List<CigarUnit> cigar = read.getAlignment() == null ? null : read.getAlignment().getCigar(); if (cigar != null && cigar.size() > 0) { StringBuilder cigarString = new StringBuilder(); for (CigarUnit unit : cigar) { cigarString.append(String.valueOf(unit.getOperationLength())); cigarString.append(CIGAR_OPERATIONS.get(unit.getOperation())); } return cigarString.toString(); } return null; }
public static String getCigarString(Read read) { List<CigarUnit> cigar = read.getAlignment() == null ? null : read.getAlignment().getCigarList(); if (cigar != null && cigar.size() > 0) { StringBuilder cigarString = new StringBuilder(); for (CigarUnit unit : cigar) { cigarString.append(String.valueOf(unit.getOperationLength())); cigarString.append(CIGAR_OPERATIONS.get(unit.getOperation().toString())); } return cigarString.toString(); } return null; }
/* package */ void closeAll() { String s; for (Iterator<String> it = map.keySet().iterator(); it.hasNext(); ) { s = it.next(); ViewAdapter viewAdapter = map.get(s); viewAdapter.removeAllViews(); viewAdapter.destroy(); views.inverse().remove(viewAdapter); it.remove(); } }
public void testMapConstructor() { /* Test with non-empty Map. */ Map<String, String> map = ImmutableMap.of( "canada", "dollar", "chile", "peso", "switzerland", "franc"); HashBiMap<String, String> bimap = HashBiMap.create(map); assertEquals("dollar", bimap.get("canada")); assertEquals("canada", bimap.inverse().get("dollar")); }
public static void processLens(OrePrefix lensPrefix, GemMaterial material) { ItemStack stack = OreDictUnifier.get(lensPrefix, material); RecipeMaps.LATHE_RECIPES.recipeBuilder() .input(OrePrefix.plate, material) .outputs(stack, OreDictUnifier.get(OrePrefix.dustSmall, material)) .duration((int) (material.getMass() / 2L)) .EUt(16) .buildAndRegister(); EnumDyeColor dyeColor = GTUtility.determineDyeColor(material.materialRGB); MarkerMaterial colorMaterial = MarkerMaterials.Color.COLORS.get(dyeColor); OreDictUnifier.registerOre(stack, OrePrefix.craftingLens, colorMaterial); }