int mainComponentIndex = -1; int component = 0; for (Integer key : componentCoordinates.keySet()) { List<Coordinate> coords = componentCoordinates.get(key); Coordinate[] coordArray = new Coordinate[coords.size()];
@Override public Set<String> getParameterKeys() { return this.parameters.keySet(); }
public Set<OPath> keySet() { return decomposition.keySet(); }
for (Long domainId : dhcpOptionsPerDomain.keySet()) { VspDomain vspDomain = _nuageVspEntityBuilder.buildVspDomain(_domainDao.findById(domainId)); VspNetwork vspNetworkForDomain = new VspNetwork.Builder().fromObject(vspNetwork).domain(vspDomain).build();
@Override public Set<E> getAcceptableEvents() { if(acceptableEvents==null) { Set<E> events = Sets.newHashSet(); events.addAll(getTransitions().keySet()); acceptableEvents = Collections.unmodifiableSet(events); } return acceptableEvents; }
/** * Get a processed represenation of the parameters for external use */ @Override public Map<String, String> getCookedParameters() { final Map<String, String> ext = new TreeMap<>(); for (final String key : this.parameters.keySet()) { ext.put(key.toString(), getStringParameter(key)); } return ext; }
/** * Use this if you expect only one header and are in a handlebars org OGNL context. * <p /> * In those contexts this method allows you to write <pre>result.firstHeaders.location</pre> instead of * <pre>result.getFirstHeader("location")</pre> * @return a map with the first header of the collection indexed by the lowercased fieldname */ public Map<String, String> getFirstHeaders() { HashMap<String, String> result = new HashMap<>(); for (String key : headers.keySet()) { result.put(key.toLowerCase(), headers.get(key).get(0)); } return result; }
/** * Use this if you expect only one header and are in a handlebars org OGNL context. * <p /> * In those contexts this method allows you to write <pre>result.firstHeaders.location</pre> instead of * <pre>result.getFirstHeader("location")</pre> * @return a map with the first header of the collection indexed by the lowercased fieldname */ public Map<String, String> getFirstHeaders() { HashMap<String, String> result = new HashMap<>(); for (String key : headers.keySet()) { result.put(key.toLowerCase(), headers.get(key).get(0)); } return result; }
static String canonicalizeXiaomiHeaders( LinkedListMultimap<String, String> headers) { if (headers == null) { return ""; } // 1. Sort the header and merge the values Map<String, String> sortedHeaders = new TreeMap<String, String>(); Set<String> keySet = headers.keySet(); for (String k : keySet) { String key = k.toLowerCase(); if (!key.startsWith(Common.XIAOMI_HEADER_PREFIX)) { continue; } List<String> entries = headers.get(k); sortedHeaders.put(key, Joiner.on(',').join(entries)); } // 2. TODO(wuzesheng) Unfold multiple lines long header // 3. Generate the canonicalized result StringBuilder result = new StringBuilder(); for (Map.Entry<String, String> entry : sortedHeaders.entrySet()) { result.append(entry.getKey()).append(":") .append(entry.getValue()).append("\n"); } return result.toString(); }
@Override public void prioritizeTransitions() { for(E key : getTransitions().keySet()) { List<ImmutableTransition<T, S, E, C>> trans = transitions.get(key); Collections.sort(trans, new Comparator<ImmutableTransition<T, S, E, C>>() { @Override public int compare(ImmutableTransition<T, S, E, C> o1, ImmutableTransition<T, S, E, C> o2) { return o2.getPriority()-o1.getPriority(); } }); } }
static String canonicalizeXiaomiHeaders( LinkedListMultimap<String, String> headers) { if (headers == null) { return ""; } // 1. Sort the header and merge the values Map<String, String> sortedHeaders = new TreeMap<String, String>(); for (String key : headers.keySet()) { if (!key.toLowerCase().startsWith(HttpKeys.XIAOMI_HEADER_PREFIX)) { continue; } StringBuilder builder = new StringBuilder(); int index = 0; for (String value : headers.get(key)) { if (index != 0) { builder.append(","); } builder.append(value); index++; } sortedHeaders.put(key, builder.toString()); } // 3. Generate the canonicalized result StringBuilder result = new StringBuilder(); for (Entry<String, String> entry : sortedHeaders.entrySet()) { result.append(entry.getKey()).append(":") .append(entry.getValue()).append("\n"); } return result.toString(); }
static String canonicalizeXiaomiHeaders( LinkedListMultimap<String, String> headers) { if (headers == null) { return ""; } // 1. Sort the header and merge the values Map<String, String> sortedHeaders = new TreeMap<String, String>(); for (String key : headers.keySet()) { if (!key.toLowerCase().startsWith(HttpKeys.XIAOMI_HEADER_PREFIX)) { continue; } StringBuilder builder = new StringBuilder(); int index = 0; for (String value : headers.get(key)) { if (index != 0) { builder.append(","); } builder.append(value); index++; } sortedHeaders.put(key, builder.toString()); } // 3. Generate the canonicalized result StringBuilder result = new StringBuilder(); for (Entry<String, String> entry : sortedHeaders.entrySet()) { result.append(entry.getKey()).append(":") .append(entry.getValue()).append("\n"); } return result.toString(); }
static String canonicalizeXiaomiHeaders( LinkedListMultimap<String, String> headers) { if (headers == null) { return ""; } // 1. Sort the header and merge the values Map<String, String> sortedHeaders = new TreeMap<String, String>(); for (String key : headers.keySet()) { if (!key.toLowerCase().startsWith(HttpKeys.XIAOMI_HEADER_PREFIX)) { continue; } StringBuilder builder = new StringBuilder(); int index = 0; for (String value : headers.get(key)) { if (index != 0) { builder.append(","); } builder.append(value); index++; } sortedHeaders.put(key, builder.toString()); } // 3. Generate the canonicalized result StringBuilder result = new StringBuilder(); for (Entry<String, String> entry : sortedHeaders.entrySet()) { result.append(entry.getKey()).append(":") .append(entry.getValue()).append("\n"); } return result.toString(); }
for (String key : params.keySet()) { for (String value : params.get(key)) { if (SUB_RESOURCE_SET.contains(key)) {
for (String key : params.keySet()) { for (String value : params.get(key)) { if (SUB_RESOURCE_SET.contains(key)) {
for (String key : params.keySet()) { for (String value : params.get(key)) { if (SUB_RESOURCE_SET.contains(key)) {
static int countExampleMethods(final String project, final String projFQName) throws IOException { // Get all java files in source folder final Set<String> callingMethods = new HashSet<>(); final List<File> files = (List<File>) FileUtils.listFiles(new File(exampleFolder + project), new String[] { "java" }, true); Collections.sort(files); for (final File file : files) { // Ignore empty files if (file.length() == 0) continue; final APICallVisitor acv = new APICallVisitor(ASTVisitors.getAST(file), namespaceFolder); acv.process(); final LinkedListMultimap<String, String> fqAPICalls = acv.getAPINames(projFQName); for (final String fqCaller : fqAPICalls.keySet()) { callingMethods.add(fqCaller); } } return callingMethods.size(); }
for (final MethodDeclaration method : apiCalls.keySet()) { for (final Expression exp : apiCalls.get(method)) { final String fqCallingMethod = methodNames.get(method);
for (String fieldName : expectation.keySet()) { if (expectation.get(fieldName).size() > 1) { result.addMultiHeaderExpectation(fieldName); for (String key : reality.keySet()) { diffResults.put(key, new DoDiff(expectation.get(key), reality.get(key))); result.add(actual.getKey(), diffResults.get(actual.getKey()).getNextResult()); for (String key : expectation.keySet()) { if (!reality.containsKey(key)) { result.add(key, new MissingPropertyDiffResult(expectation.get(key).get(0)));
public GuiHabitatLocator(EntityPlayer player, ItemInventoryHabitatLocator itemInventory) { super(Constants.TEXTURE_PATH_GUI + "/biomefinder.png", new ContainerHabitatLocator(player, itemInventory)); this.itemInventory = itemInventory; xSize = 176; ySize = 184; int slot = 0; for (String habitatName : habitats.keySet()) { int x; int y; if (slot > 5) { x = 18 + (slot - 6) * 20; y = 50; } else { x = 18 + slot * 20; y = 32; } Collection<BiomeDictionary.Type> biomes = habitats.get(habitatName); HabitatSlot habitatSlot = new HabitatSlot(widgetManager, x, y, habitatName, biomes); habitatSlots.add(habitatSlot); widgetManager.add(habitatSlot); slot++; } }