/** * A put operation that can be used in the fluent pattern. */ public Builder<KType, VType> fPut(KType key, VType value) { map.put(key, value); return this; }
transitions.put(node, transition); transitionList.add(transition); if (DependencyAnalyzer.shouldLog) {
@Override public VType put(KType key, VType value) { return map.put(key, value); }
@Override public V put(K key, V value) { if (key == null) { throw new IllegalArgumentException("Map key must not be null"); } return super.put(key, value); } };
/** * Puts all the entries in the map to the builder. */ public Builder<KType, VType> putAll(Map<KType, VType> map) { for (Map.Entry<KType, VType> entry : map.entrySet()) { this.map.put(entry.getKey(), entry.getValue()); } return this; }
/** * Creates a hash map from two index-aligned arrays of key-value pairs. */ public static <KType, VType> ObjectObjectHashMap<KType, VType> from(KType[] keys, VType[] values) { if (keys.length != values.length) { throw new IllegalArgumentException("Arrays of keys and values must have an identical length."); } ObjectObjectHashMap<KType, VType> map = new ObjectObjectHashMap<>(keys.length); for (int i = 0; i < keys.length; i++) { map.put(keys[i], values[i]); } return map; }
/** * {@inheritDoc} */ @Override public int putAll(ObjectObjectAssociativeContainer<? extends KType, ? extends VType> container) { final int count = size(); for (ObjectObjectCursor<? extends KType, ? extends VType> c : container) { put(c.key, c.value); } return size() - count; }
/** * Puts all key/value pairs from a given iterable into this map. */ @Override public int putAll(Iterable<? extends ObjectObjectCursor<? extends KType, ? extends VType>> iterable){ final int count = size(); for (ObjectObjectCursor<? extends KType, ? extends VType> c : iterable) { put(c.key, c.value); } return size() - count; }
@Override public void readFrom(StreamInput in) throws IOException { int size = in.readVInt(); termStatistics = HppcMaps.newMap(size); for (int i = 0; i < size; i++) { Term term = new Term(in.readString(), in.readBytesRef()); TermStatistics stats = new TermStatistics(in.readBytesRef(), in.readVLong(), DfsSearchResult.subOne(in.readVLong())); termStatistics.put(term, stats); } fieldStatistics = DfsSearchResult.readFieldStats(in); maxDoc = in.readVLong(); }
/** * A put operation that can be used in the fluent pattern. */ public Builder<KType, VType> fPut(KType key, VType value) { map.put(key, value); return this; }
/** * A put operation that can be used in the fluent pattern. */ public Builder<KType, VType> fPut(KType key, VType value) { map.put(key, value); return this; }
public static ObjectObjectHashMap<String, CollectionStatistics> readFieldStats(StreamInput in, ObjectObjectHashMap<String, CollectionStatistics> fieldStatistics) throws IOException { final int numFieldStatistics = in.readVInt(); if (fieldStatistics == null) { fieldStatistics = HppcMaps.newNoNullKeysMap(numFieldStatistics); } for (int i = 0; i < numFieldStatistics; i++) { final String field = in.readString(); assert field != null; final long maxDoc = in.readVLong(); final long docCount = subOne(in.readVLong()); final long sumTotalTermFreq = subOne(in.readVLong()); final long sumDocFreq = subOne(in.readVLong()); CollectionStatistics stats = new CollectionStatistics(field, maxDoc, docCount, sumTotalTermFreq, sumDocFreq); fieldStatistics.put(field, stats); } return fieldStatistics; }
@Override public V put(K key, V value) { if (key == null) { throw new IllegalArgumentException("Map key must not be null"); } return super.put(key, value); } };
@Override public V put(K key, V value) { if (key == null) { throw new IllegalArgumentException("Map key must not be null"); } return super.put(key, value); } };
@Override public V put(K key, V value) { if (key == null) { throw new IllegalArgumentException("Map key must not be null"); } return super.put(key, value); } };
termStatistics.put(terms[i], new TermStatistics(existing.term(), existing.docFreq() + stats[i].docFreq(), optionalSum(existing.totalTermFreq(), stats[i].totalTermFreq()))); } else { termStatistics.put(terms[i], stats[i]); optionalSum(existing.sumDocFreq(), value.sumDocFreq()) ); fieldStatistics.put(key, merged); } else { fieldStatistics.put(key, value);
/** * Puts all the entries in the map to the builder. */ public Builder<KType, VType> putAll(Map<KType, VType> map) { for (Map.Entry<KType, VType> entry : map.entrySet()) { this.map.put(entry.getKey(), entry.getValue()); } return this; }
/** * Puts all the entries in the map to the builder. */ public Builder<KType, VType> putAll(Map<KType, VType> map) { for (Map.Entry<KType, VType> entry : map.entrySet()) { this.map.put(entry.getKey(), entry.getValue()); } return this; }
if (indexShardStats == null) { indexShardStats = new ShardStats(); countsPerIndex.put(shardStats.getShardRouting().getIndexName(), indexShardStats);
if (!fieldStatistics.containsKey(term.field())) { final CollectionStatistics collectionStatistics = context.searcher().collectionStatistics(term.field()); fieldStatistics.put(term.field(), collectionStatistics); if(context.isCancelled()) { throw new TaskCancelledException("cancelled");