Refine search
/** * Returns an Iterator over the set of values that have been added. * <p> * If added values are integral (i.e., integers, longs, Integers, or Longs), * they are converted to Longs when they are added, so the objects returned * by the Iterator will in this case be Longs.</p> * * @return values Iterator */ public Iterator<Comparable<?>> valuesIterator() { return freqTable.keySet().iterator(); }
protected String stringToSign(SortedMap<String, String> signables) { // each key and value is followed by a newline StringBuilder sb = new StringBuilder(); for(String k: signables.keySet()){ sb.append(k).append("\n"); sb.append(signables.get(k)).append("\n"); } String result = sb.toString(); return result; }
SortedMap<Integer, String> topN = new TreeMap<Integer, String>(); while (iter.hasNext()) { Tuple2<String,Integer> tuple = iter.next(); String kmer = tuple._1; int frequency = tuple._2; List<Integer> frequencies = new ArrayList<Integer>(finaltopN.keySet()); for(int i = frequencies.size()-1; i>=0; i--) { System.out.println(frequencies.get(i) + "\t" + finaltopN.get(frequencies.get(i)));
private void validateEntries(SortedMap<KeyExtent,String> tablets) throws AccumuloException { SortedSet<KeyExtent> tabletsKeys = (SortedSet<KeyExtent>) tablets.keySet(); // sanity check of metadata table entries // make sure tablets has no holes, and that it starts and ends w/ null if (tabletsKeys.size() == 0) throw new AccumuloException( "No entries found in metadata table for table " + getServicedTableId()); if (tabletsKeys.first().getPrevEndRow() != null) throw new AccumuloException("Problem with metadata table, first entry for table " + getServicedTableId() + "- " + tabletsKeys.first() + " - has non null prev end row"); if (tabletsKeys.last().getEndRow() != null) throw new AccumuloException("Problem with metadata table, last entry for table " + getServicedTableId() + "- " + tabletsKeys.first() + " - has non null end row"); Iterator<KeyExtent> tabIter = tabletsKeys.iterator(); Text lastEndRow = tabIter.next().getEndRow(); while (tabIter.hasNext()) { KeyExtent tabke = tabIter.next(); if (tabke.getPrevEndRow() == null) throw new AccumuloException( "Problem with metadata table, it has null prev end row in middle of table " + tabke); if (!tabke.getPrevEndRow().equals(lastEndRow)) throw new AccumuloException("Problem with metadata table, it has a hole " + tabke.getPrevEndRow() + " != " + lastEndRow); lastEndRow = tabke.getEndRow(); } // end METADATA table sanity check }
for(Iterator i=headers.keySet().iterator(); i.hasNext();) { String hashKey=(String)i.next(); if(hashKey == null) continue; String lk=hashKey.toLowerCase(); for(Iterator i=interestingHeaders.keySet().iterator(); i.hasNext();) { String headerKey=(String)i.next(); if(headerKey.startsWith(AMAZON_HEADER_PREFIX)) { buf.append(headerKey).append(':').append(interestingHeaders.get(headerKey)); buf.append(interestingHeaders.get(headerKey));
private static boolean isEqualSchemaMaps(SortedMap<String, Schema> map1, SortedMap<String, Schema> map2) { if (!map1.keySet().equals(map2.keySet())) { return false; } for (String fieldKey : map1.keySet()) { if (!isEqualSchemas(map1.get(fieldKey), map2.get(fieldKey))) { return false; } } return true; }
public Object nextKey(Object key) { if (isEmpty()) { return null; } if (maps[0] instanceof OrderedMap) { return ((OrderedMap) maps[0]).nextKey(key); } SortedMap sm = (SortedMap) maps[0]; Iterator it = sm.tailMap(key).keySet().iterator(); it.next(); if (it.hasNext()) { return it.next(); } return null; }
public LoginCacheKey(SortedMap<String, ?> authConf) throws IOException { if (authConf != null) { StringBuilder stringBuilder = new StringBuilder(); for (String configKey : authConf.keySet()) { //DISABLE_LOGIN_CACHE indicates whether or not to use the LoginCache. //So we exclude it from the keyString if (configKey.equals(DISABLE_LOGIN_CACHE)) { continue; } String configValue = (String) authConf.get(configKey); stringBuilder.append(configKey); stringBuilder.append(configValue); } keyString = stringBuilder.toString(); } else { throw new IllegalArgumentException("Configuration should not be null"); } }
private void filterOffsets(long fromOffset, long toOffset) { Iterator iterator = mTopicPartitionToOffsetToFiles.entrySet().iterator(); while (iterator.hasNext()) { long firstOffset = -2; long lastOffset = Long.MAX_VALUE; Map.Entry entry = (Map.Entry) iterator.next(); SortedMap<Long, HashSet<LogFilePath>> offsetToFiles = (SortedMap<Long, HashSet<LogFilePath>>) entry.getValue(); for (long offset : offsetToFiles.keySet()) { if (offset <= fromOffset || firstOffset == -2) { firstOffset = offset; } if (offset >= toOffset && toOffset == Long.MAX_VALUE) { lastOffset = offset; } } if (firstOffset != -2) { TopicPartition topicPartition = (TopicPartition) entry.getKey(); offsetToFiles = offsetToFiles.subMap(firstOffset, lastOffset); mTopicPartitionToOffsetToFiles.put(topicPartition, offsetToFiles); } } }
public Object nextKey(Object key) { if (isEmpty()) { return null; } if (maps[0] instanceof OrderedMap) { return ((OrderedMap) maps[0]).nextKey(key); } SortedMap sm = (SortedMap) maps[0]; Iterator it = sm.tailMap(key).keySet().iterator(); it.next(); if (it.hasNext()) { return it.next(); } return null; }
/** * Creates a new iterator, which allows to iterate the event handlers of a {@link * TouchEventDispatcher}. */ EventHandlerIterator() { priorityIterator = eventHandlers.keySet().iterator(); if (priorityIterator.hasNext()) { int key = priorityIterator.next(); ListenerList<AbstractTouchEventHandler> handlers = eventHandlers.get(key); eventHandlerIterator = handlers.iterator(); } else { eventHandlerIterator = null; } }