MCPcopy Create free account
hub / github.com/antlr/codebuff / Segment

Method Segment

output/java_guava/1.4.13/LocalCache.java:2173–2192  ·  view source on GitHub ↗
(LocalCache<K, V> map, int initialCapacity, long maxSegmentWeight, StatsCounter statsCounter)

Source from the content-addressed store, hash-verified

2171 final StatsCounter statsCounter;
2172
2173 Segment(LocalCache<K, V> map, int initialCapacity, long maxSegmentWeight, StatsCounter statsCounter) {
2174 this.map = map;
2175 this.maxSegmentWeight = maxSegmentWeight;
2176 this.statsCounter = checkNotNull(statsCounter);
2177 initTable(newEntryArray(initialCapacity));
2178 keyReferenceQueue = map.usesKeyReferences() ? new ReferenceQueue<K>() : null;
2179 valueReferenceQueue = map.usesValueReferences() ? new ReferenceQueue<V>() : null;
2180 recencyQueue =
2181 map.usesAccessQueue()
2182 ? new ConcurrentLinkedQueue<ReferenceEntry<K, V>>()
2183 : LocalCache.<ReferenceEntry<K, V>>discardingQueue();
2184 writeQueue =
2185 map.usesWriteQueue()
2186 ? new WriteQueue<K, V>()
2187 : LocalCache.<ReferenceEntry<K, V>>discardingQueue();
2188 accessQueue =
2189 map.usesAccessQueue()
2190 ? new AccessQueue<K, V>()
2191 : LocalCache.<ReferenceEntry<K, V>>discardingQueue();
2192 }
2193
2194 AtomicReferenceArray<ReferenceEntry<K, V>> newEntryArray(int size) {
2195 return new AtomicReferenceArray<ReferenceEntry<K, V>>(size);

Callers

nothing calls this directly

Calls 8

initTableMethod · 0.95
newEntryArrayMethod · 0.95
discardingQueueMethod · 0.95
checkNotNullMethod · 0.45
usesKeyReferencesMethod · 0.45
usesValueReferencesMethod · 0.45
usesAccessQueueMethod · 0.45
usesWriteQueueMethod · 0.45

Tested by

no test coverage detected