java.util.LinkedHashMap.keySet()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(304)

本文整理了Java中java.util.LinkedHashMap.keySet()方法的一些代码示例,展示了LinkedHashMap.keySet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LinkedHashMap.keySet()方法的具体详情如下:
包路径:java.util.LinkedHashMap
类名称:LinkedHashMap
方法名:keySet

LinkedHashMap.keySet介绍

暂无

代码示例

代码示例来源:origin: lipangit/JiaoZiVideoPlayer

public Object getValueFromLinkedMap(int index) {
  int currentIndex = 0;
  for (Object key : urlsMap.keySet()) {
    if (currentIndex == index) {
      return urlsMap.get(key);
    }
    currentIndex++;
  }
  return null;
}

代码示例来源:origin: apache/geode

/**
 * Returns an iterator of the {@code String} names in this object. The returned iterator supports
 * {@link Iterator#remove() remove}, which will remove the corresponding mapping from this object.
 * If this object is modified after the iterator is returned, the iterator's behavior is
 * undefined. The order of the keys is undefined.
 *
 * @return an iterator over the keys.
 */
public Iterator<String> keys() {
 return nameValuePairs.keySet().iterator();
}

代码示例来源:origin: loklak/loklak_server

private void checkSize() {
  if (this.map.size() >= this.maxSize) {
    Iterator<K> i = this.map.keySet().iterator();
    while (i.hasNext() && this.map.size() > this.maxSize) this.map.remove(i.next());
  }
}

代码示例来源:origin: redisson/redisson

/**
 * Returns a string representation of the annotation.
 */
public String toString() {
  StringBuffer buf = new StringBuffer("@");
  buf.append(getTypeName());
  if (members != null) {
    buf.append("(");
    Iterator mit = members.keySet().iterator();
    while (mit.hasNext()) {
      String name = (String)mit.next();
      buf.append(name).append("=").append(getMemberValue(name));
      if (mit.hasNext())
        buf.append(", ");
    }
    buf.append(")");
  }
  return buf.toString();
}

代码示例来源:origin: apache/activemq

JClass c = (JClass)iter.next();
  classNames.put(c, c);
  JClass c = (JClass)iter.next();
  if (!classNames.containsKey(c.getSuperclass())) {
    rc.put(c, c);
  JClass c = (JClass)iter.next();
  if (!rc.containsKey(c)) {
    rc.put(c, c);
return new ArrayList<JClass>(rc.keySet());

代码示例来源:origin: apache/hive

Set<String> aggExprs = qbPI.getDestToAggregationExprs().values().iterator().next().keySet();

代码示例来源:origin: apache/incubator-druid

expectedPageIds.put(segmentId1, 1);
expectedPageIds.put(segmentId2, 2);
Iterator<String> exSegmentIter = expectedPageIds.keySet().iterator();
Iterator<String> acSegmentIter = merged.getValue().getPagingIdentifiers().keySet().iterator();

代码示例来源:origin: osmandapp/Osmand

LinkedHashMap<String, String> map = new LinkedHashMap<String, String>();
if (zoom != NO_ZOOM)
  map.put("z", String.valueOf(zoom));
if (query != null)
  map.put("q", URLEncoder.encode(query));
if (label != null)
  if (query == null)
    map.put("q", latlon + "(" + URLEncoder.encode(label) + ")");
if (map.size() > 0)
  uriString += "?";
int i = 0;
for (String key : map.keySet()) {
  if (i > 0)
    uriString += "&";
  uriString += key + "=" + map.get(key);
  i++;

代码示例来源:origin: PipelineAI/pipeline

Integer counter = aggregatedCommandsExecuted.get(display);
  if( counter != null){
    aggregatedCommandsExecuted.put(display, counter + 1);
  } else {
    aggregatedCommandsExecuted.put(display, 1);
for (String displayString : aggregatedCommandsExecuted.keySet()) {
  if (builder.length() > 0) {
    builder.append(", ");
  builder.append("[").append(totalExecutionTime).append("ms]");
  int count = aggregatedCommandsExecuted.get(displayString);
  if (count > 1) {
    builder.append("x").append(count);

代码示例来源:origin: JesusFreke/smali

if (superclass != null) {
  ClassProto superclassProto = (ClassProto) classPath.getClass(superclass);
  for (String superclassInterface: superclassProto.getInterfaces().keySet()) {
    interfaces.put(superclassInterface, null);
        for (Entry<String, ClassDef> entry: interfaceProto.getInterfaces().entrySet()) {
          if (!interfaces.containsKey(entry.getKey())) {
            interfaces.put(entry.getKey(), entry.getValue());
        interfaces.put(interfaceType, null);
        unresolvedInterfaces.add(interfaceType);
        interfacesFullyResolved = false;

代码示例来源:origin: spring-projects/spring-data-mongodb

private boolean lastOperatorWasNot() {
  return !this.criteria.isEmpty() && "$not".equals(this.criteria.keySet().toArray()[this.criteria.size() - 1]);
}

代码示例来源:origin: wildfly/wildfly

/**
 * Construct this security domain.
 *
 * Construction requires {@code createSecurityDomain} {@link ElytronPermission}.
 *
 * @return the new security domain
 */
public SecurityDomain build() {
  final SecurityManager sm = System.getSecurityManager();
  if (sm != null) {
    sm.checkPermission(CREATE_SECURITY_DOMAIN);
  }
  final LinkedHashMap<String, RealmInfo> realmMap = new LinkedHashMap<>(realms.size());
  for (RealmBuilder realmBuilder : realms.values()) {
    realmMap.put(realmBuilder.getName(), new RealmInfo(realmBuilder));
  }
  if (defaultRealmName != null && !realmMap.containsKey(defaultRealmName)) {
    throw log.realmMapDoesNotContainDefault(defaultRealmName);
  }
  assertNotBuilt();
  built = true;
  if(log.isTraceEnabled()) {
    log.tracef("Building security domain with defaultRealmName %s.", defaultRealmName);
    if(realmMap.size() > 1) {
      log.tracef("The following additional realms were added: %s.", realmMap.keySet().toString());
    }
  }
  return new SecurityDomain(this, realmMap);
}

代码示例来源:origin: apache/drill

List<Path> pathsToAdd = new LinkedList<Path>();
for (String alias : work.getAliasToWork().keySet()) {
 LOG.info("Processing alias " + alias);
 boolean hasLogged = false;
 for (Path file : new LinkedList<Path>(work.getPathToAliases().keySet())) {
  List<String> aliases = work.getPathToAliases().get(file);
  if (aliases.contains(alias)) {
   if (file != null) {
   } else if (!hasLogged) {
    hasLogged = true;
    LOG.info("Adding " + work.getPathToAliases().size()
      + " inputs; the first input is " + file);

代码示例来源:origin: markzhai/AndroidPerformanceMonitor

@Override
  protected void doSample() {
    StringBuilder stringBuilder = new StringBuilder();

    for (StackTraceElement stackTraceElement : mCurrentThread.getStackTrace()) {
      stringBuilder
          .append(stackTraceElement.toString())
          .append(BlockInfo.SEPARATOR);
    }

    synchronized (sStackMap) {
      if (sStackMap.size() == mMaxEntryCount && mMaxEntryCount > 0) {
        sStackMap.remove(sStackMap.keySet().iterator().next());
      }
      sStackMap.put(System.currentTimeMillis(), stringBuilder.toString());
    }
  }
}

代码示例来源:origin: apache/hive

public String getBigTableAlias() {
 return ((MapWork) bigTableWork).getAliasToWork().keySet().iterator().next();
}

代码示例来源:origin: org.codehaus.jackson/jackson-mapper-asl

@Override
public Iterator<String> getFieldNames()
{
  return (_children == null) ? NoStringsIterator.instance() : _children.keySet().iterator();
}

代码示例来源:origin: pentaho/pentaho-kettle

map.put( rowMetaAndData, new TimedRow( add ) );
if ( !meta.isLoadingAllDataInCache() && meta.getCacheSize() > 0 && map.size() > meta.getCacheSize() ) {
 List<RowMetaAndData> keys = new ArrayList<RowMetaAndData>( map.keySet() );
 List<Date> samples = new ArrayList<Date>();
 int incr = keys.size() / 10;
  TimedRow timedRow = map.get( key );
  samples.add( timedRow.getLogDate() );
   TimedRow timedRow = map.get( key );

代码示例来源:origin: marytts/marytts

for (MaryModule m : list) {
      if (!results.containsKey(m.outputType()))
        results.put(m.outputType(), m);
for (MaryDataType t : results.keySet()) {
  returnList.add(results.get(t));

代码示例来源:origin: SonarSource/sonarqube

public Set<String> getBucketKeys(String facetName) {
 LinkedHashMap<String, Long> facet = facetsByName.get(facetName);
 if (facet != null) {
  return facet.keySet();
 }
 return Collections.emptySet();
}

代码示例来源:origin: redisson/redisson

for (MethodDescription methodDescription : typeDescription.getDeclaredMethods()) {
        if (!declaredMethods.contains(methodDescription)) {
          implementations.put(methodDescription, entry.asSupplementaryEntry(methodDescription));
          declaredMethods.add(methodDescription);
ElementMatcher<? super MethodDescription> relevanceMatcher = (ElementMatcher<? super MethodDescription>) not(anyOf(implementations.keySet()))
    .and(returns(isVisibleTo(instrumentedType)))
    .and(hasParameters(whereNone(hasType(not(isVisibleTo(instrumentedType))))))
    for (Entry entry : entries) {
      if (entry.resolve(instrumentedType).matches(methodDescription)) {
        implementations.put(methodDescription, entry.asPreparedEntry(instrumentedType,
            methodDescription,
            node.getMethodTypes(),
      && methodDescription.getDeclaringType().isPackagePrivate()) {
    implementations.put(methodDescription, Prepared.Entry.forVisibilityBridge(methodDescription, node.getVisibility()));

相关文章