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

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

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

LinkedHashMap.values介绍

暂无

代码示例

代码示例来源:origin: square/okhttp

void trimToSize() throws IOException {
 while (size > maxSize) {
  Entry toEvict = lruEntries.values().iterator().next();
  removeEntry(toEvict);
 }
 mostRecentTrimFailed = false;
}

代码示例来源:origin: alibaba/druid

@Override
public Object getValueAt(int rowIndex, int columnIndex) {
  if (list != null && rowIndex < list.size()) {// 没有超出最大行数
    LinkedHashMap<String, Object> dataNow = list.get(rowIndex);
    if (showKeys != null) {
      int titleLen = showKeys.size();
      if (titleLen > 0 && columnIndex < titleLen) {
        return dataNow.get(showKeys.get(columnIndex));
      }
    } else {
      Object[] values = dataNow.values().toArray();
      if (columnIndex < values.length) {
        return values[columnIndex];
      }
    }
  }
  return null;
}

代码示例来源:origin: square/okhttp

/**
 * Deletes all stored values from the cache. In-flight edits will complete normally but their
 * values will not be stored.
 */
public synchronized void evictAll() throws IOException {
 initialize();
 // Copying for safe iteration.
 for (Entry entry : lruEntries.values().toArray(new Entry[lruEntries.size()])) {
  removeEntry(entry);
 }
 mostRecentTrimFailed = false;
}

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

private AuthenticationEntryPoint createDefaultEntryPoint(H http) {
  if (this.defaultEntryPointMappings.isEmpty()) {
    return new Http403ForbiddenEntryPoint();
  }
  if (this.defaultEntryPointMappings.size() == 1) {
    return this.defaultEntryPointMappings.values().iterator().next();
  }
  DelegatingAuthenticationEntryPoint entryPoint = new DelegatingAuthenticationEntryPoint(
      this.defaultEntryPointMappings);
  entryPoint.setDefaultEntryPoint(this.defaultEntryPointMappings.values().iterator()
      .next());
  return entryPoint;
}

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

List<Integer> coll = metaNameToIndex.getOrDefault( metaFieldNames[i], new ArrayList<>() );
 coll.add( i );
 metaNameToIndex.put( metaFieldNames[i], coll );
  List<Integer> columnIndexes = metaNameToIndex.get( actualFieldNames[ i ] );
  if ( columnIndexes == null || columnIndexes.isEmpty() ) {
   unmatchedMetaFields.add( i );
Iterator<Integer> remainingMetaIndexes = metaNameToIndex.values().stream()
 .flatMap( List::stream )
 .sorted()
  break;
 actualToMetaFieldMapping[ idx ] = remainingMetaIndexes.next();

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

roots.addAll(((MapWork) work).getAliasToWork().values());
} else {
 roots.addAll(work.getAllRootOperators());
 Operator<?> newRoot = newRootsIt.next();
 List<Operator<?>> newOpQueue = new LinkedList<Operator<?>>();
 collectOperators(newRoot, newOpQueue);
 Iterator<Operator<?>> newOpQueueIt = newOpQueue.iterator();
 for (Operator<?> op : opQueue) {
  Operator<?> newOp = newOpQueueIt.next();
 Operator<?> newRoot = it.next();
 if (newRoot instanceof HashTableDummyOperator) {
  dummyOps.add((HashTableDummyOperator) newRoot);

代码示例来源:origin: zendesk/maxwell

private Iterator<InflightMessage> iterator() {
    return this.linkedMap.values().iterator();
  }
}

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

String className = System.getProperty(JAVAX_CACHE_CACHING_PROVIDER);
  providers = new LinkedHashMap<String, CachingProvider>();
  providers.put(className, loadCachingProvider(className, serviceClassLoader));
return providers.values();

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

expectedPageIds.put(segmentId1, 1);
expectedPageIds.put(segmentId2, 2);
Iterator<Integer> exOffsetIter = expectedPageIds.values().iterator();
Iterator<Integer> acOffsetIter = merged.getValue().getPagingIdentifiers().values().iterator();

代码示例来源:origin: com.alibaba/fastjson

LinkedHashMap<String,FieldInfo> map = new LinkedHashMap<String,FieldInfo>(fieldInfoList.size());
for(FieldInfo field : fieldInfoMap.values()){
  map.put(field.name, field);
  FieldInfo field = map.get(item);
  if(field != null){
    fieldInfoList.add(field);
for(FieldInfo field : map.values()){
  fieldInfoList.add(field);

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

protected void _renameUsing(PropertyNamingStrategy naming)
  POJOPropertyBuilder[] props = _properties.values().toArray(new POJOPropertyBuilder[_properties.size()]);
  _properties.clear();
  for (POJOPropertyBuilder prop : props) {
    POJOPropertyBuilder old = _properties.get(name);
    if (old == null) {
      _properties.put(name, prop);
    } else {
      old.addAll(prop);

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

Many(final Credential c1, final Many subsequent) {
  LinkedHashMap<Key, Credential> map = new LinkedHashMap<>(subsequent.map.size() + 1);
  map.put(Key.of(c1), c1);
  map.putAll(subsequent.map);
  this.map = map;
  int hc = 0;
  for (Credential credential : map.values()) {
    hc ^= typeHash(credential);
  }
  hashCode = hc;
  assert size() > 2;
}

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

private static Collection<Path> hitsToPaths( Collection<Hit> depthHits, Node start, Node end, boolean stopAsap, int maxResultCount )
{
  LinkedHashMap<String,Path> paths = new LinkedHashMap<>();
  for ( Hit hit : depthHits )
  {
    for ( Path path : hitToPaths( hit, start, end, stopAsap ) )
    {
      paths.put( path.toString(), path );
      if ( paths.size() >= maxResultCount )
      {
        break;
      }
    }
  }
  return paths.values();
}

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

return;
int size = _properties.size();
Map<String, POJOPropertyBuilder> all;
for (POJOPropertyBuilder prop : _properties.values()) {
  all.put(prop.getName(), prop);
    POJOPropertyBuilder w = all.get(name);
    if (w == null) { // also, as per [JACKSON-268], we will allow use of "implicit" names
      for (POJOPropertyBuilder prop : _properties.values()) {
        if (name.equals(prop.getInternalName())) {
          w = prop;

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

public IdentityCredentials withoutMatching(final Credential credential) {
  final Key key = Key.of(credential);
  if (map.containsKey(key)) {
    final LinkedHashMap<Key, Credential> clone = new LinkedHashMap<>(map);
    clone.remove(key);
    if (clone.size() == 2) {
      final Iterator<Credential> iterator = clone.values().iterator();
      return new Two(iterator.next(), iterator.next());
    } else {
      return new Many(clone);
    }
  } else {
    return this;
  }
}

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

void completeDelayedChannelClose(long currentTimeNanos) {
  if (delayedClosingChannels == null)
    return;
  while (!delayedClosingChannels.isEmpty()) {
    DelayedAuthenticationFailureClose delayedClose = delayedClosingChannels.values().iterator().next();
    if (!delayedClose.tryClose(currentTimeNanos))
      break;
  }
}

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

@Override
  public Iterator<AnnotatedMethod> iterator()
  {
    if (_methods != null) {
      return _methods.values().iterator();
    }
    List<AnnotatedMethod> empty = Collections.emptyList();
    return empty.iterator();
  }
}

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

/**
 * Combines this store with the given store.
 *
 * @param store The store to combine with this store.
 * @return A store representing a combination of this store and the given store.
 */
protected Store<V> combineWith(Store<V> store) {
  if (entries.isEmpty()) {
    return store;
  } else if (store.entries.isEmpty()) {
    return this;
  }
  LinkedHashMap<Harmonized<V>, Entry<V>> entries = new LinkedHashMap<Harmonized<V>, Entry<V>>(this.entries);
  for (Entry<V> entry : store.entries.values()) {
    Entry<V> previousEntry = entries.remove(entry.getKey()), injectedEntry = previousEntry == null
        ? entry
        : combine(previousEntry, entry);
    entries.put(injectedEntry.getKey(), injectedEntry);
  }
  return new Store<V>(entries);
}

代码示例来源:origin: alibaba/fastjson

LinkedHashMap<String, FieldInfo> map = new LinkedHashMap<String, FieldInfo>(fieldList.size());
for (FieldInfo field : fields) {
  map.put(field.name, field);
  FieldInfo field = map.get(item);
  if (field != null) {
    sortedFields[i++] = field;
for (FieldInfo field : map.values()) {
  sortedFields[i++] = field;

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

String tableName = conf.getPathToPartitionInfo().get(e.getKey()).getTableName();
 if (tableNameToConf.containsKey(tableName)) {
  continue;
  Operator<?> rootOp = conf.getAliasToWork().get(alias);
  if (!(rootOp instanceof TableScanOperator)) {
   continue;
for (PartitionDesc pd : conf.getPathToPartitionInfo().values()) {
 if (!tableNameToConf.containsKey(pd.getTableName())) {
  tableNameToConf.put(pd.getTableName(), hconf);
for (PartitionDesc pd: conf.getAliasToPartnInfo().values()) {
 if (!tableNameToConf.containsKey(pd.getTableName())) {
  tableNameToConf.put(pd.getTableName(), hconf);

相关文章