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

Method Segment

corpus/java/training/guava/cache/LocalCache.java:2096–2124  ·  view source on GitHub ↗
(
        LocalCache<K, V> map,
        int initialCapacity,
        long maxSegmentWeight,
        StatsCounter statsCounter)

Source from the content-addressed store, hash-verified

2094 final StatsCounter statsCounter;
2095
2096 Segment(
2097 LocalCache<K, V> map,
2098 int initialCapacity,
2099 long maxSegmentWeight,
2100 StatsCounter statsCounter) {
2101 this.map = map;
2102 this.maxSegmentWeight = maxSegmentWeight;
2103 this.statsCounter = checkNotNull(statsCounter);
2104 initTable(newEntryArray(initialCapacity));
2105
2106 keyReferenceQueue = map.usesKeyReferences() ? new ReferenceQueue<K>() : null;
2107
2108 valueReferenceQueue = map.usesValueReferences() ? new ReferenceQueue<V>() : null;
2109
2110 recencyQueue =
2111 map.usesAccessQueue()
2112 ? new ConcurrentLinkedQueue<ReferenceEntry<K, V>>()
2113 : LocalCache.<ReferenceEntry<K, V>>discardingQueue();
2114
2115 writeQueue =
2116 map.usesWriteQueue()
2117 ? new WriteQueue<K, V>()
2118 : LocalCache.<ReferenceEntry<K, V>>discardingQueue();
2119
2120 accessQueue =
2121 map.usesAccessQueue()
2122 ? new AccessQueue<K, V>()
2123 : LocalCache.<ReferenceEntry<K, V>>discardingQueue();
2124 }
2125
2126 AtomicReferenceArray<ReferenceEntry<K, V>> newEntryArray(int size) {
2127 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