@Override public ObjectCollection<V> values() { synchronized (sync) { if (values == null) return ObjectCollections.synchronize(map.values(), sync); return values; } } @Override
@Override public ObjectCollection<V> values() { if (values == null) return ObjectCollections.unmodifiable(map.values()); return values; } @Override
/** * Gets a collection of all worlds held by the world manager. * * @return A collection of all worlds held by the world manager */ public Collection<WorldAdapter> getWorlds() { if (!GoMint.instance().isMainThread()) { LOGGER.warn("Getting worlds from an async thread. This is not safe and can lead to CME", new Exception()); } return this.loadedWorlds.values(); }
public int numRecords() { Optional<Integer> result = this.store.values().stream().map(bedRecords -> bedRecords.size()).reduce((size1, size2) -> size1 + size2); return result.get(); }
@Override public void close() throws IOException { for( IndexReader indexReader: term2IndexReader.values() ) indexReader.close(); term2IndexReader.clear(); } }
@Override public void close() throws IOException { for( IndexReader indexReader: term2IndexReader.values() ) indexReader.close(); term2IndexReader.clear(); } }
@ManagedAttribute @Description("Pages currently crawled by all threads") public Set<URI> getCurrentPages() { return new ObjectOpenHashSet<URI>( currentCrawledURIs.values() ); }
for (Object2IntFrequencyDistribution<K> fd : distributions.values()) { long conditionalSum = 0;