@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; }
/** * 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; }
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; }
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();
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);
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);
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);
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; }
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(); }
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;
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; } }
void completeDelayedChannelClose(long currentTimeNanos) { if (delayedClosingChannels == null) return; while (!delayedClosingChannels.isEmpty()) { DelayedAuthenticationFailureClose delayedClose = delayedClosingChannels.values().iterator().next(); if (!delayedClose.tryClose(currentTimeNanos)) break; } }
/** * 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); }
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;
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);