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

Method Segment

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

Source from the content-addressed store, hash-verified

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