AbstractCache.java
4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
package com.google.common.cache;
import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutionException;
import mn;
import mo;
@Beta
@GwtCompatible
public abstract class AbstractCache<K, V>
implements Cache<K, V>
{
public ConcurrentMap<K, V> asMap()
{
throw new UnsupportedOperationException();
}
public void cleanUp() {}
public V get(K paramK, Callable<? extends V> paramCallable)
throws ExecutionException
{
throw new UnsupportedOperationException();
}
public ImmutableMap<K, V> getAllPresent(Iterable<?> paramIterable)
{
LinkedHashMap localLinkedHashMap = Maps.newLinkedHashMap();
paramIterable = paramIterable.iterator();
while (paramIterable.hasNext())
{
Object localObject1 = paramIterable.next();
if (!localLinkedHashMap.containsKey(localObject1))
{
Object localObject2 = getIfPresent(localObject1);
if (localObject2 != null) {
localLinkedHashMap.put(localObject1, localObject2);
}
}
}
return ImmutableMap.copyOf(localLinkedHashMap);
}
public void invalidate(Object paramObject)
{
throw new UnsupportedOperationException();
}
public void invalidateAll()
{
throw new UnsupportedOperationException();
}
public void invalidateAll(Iterable<?> paramIterable)
{
paramIterable = paramIterable.iterator();
while (paramIterable.hasNext()) {
invalidate(paramIterable.next());
}
}
public void put(K paramK, V paramV)
{
throw new UnsupportedOperationException();
}
public void putAll(Map<? extends K, ? extends V> paramMap)
{
paramMap = paramMap.entrySet().iterator();
while (paramMap.hasNext())
{
Map.Entry localEntry = (Map.Entry)paramMap.next();
put(localEntry.getKey(), localEntry.getValue());
}
}
public long size()
{
throw new UnsupportedOperationException();
}
public CacheStats stats()
{
throw new UnsupportedOperationException();
}
@Beta
public static final class SimpleStatsCounter
implements AbstractCache.StatsCounter
{
private final mn a = mo.a();
private final mn b = mo.a();
private final mn c = mo.a();
private final mn d = mo.a();
private final mn e = mo.a();
private final mn f = mo.a();
public final void incrementBy(AbstractCache.StatsCounter paramStatsCounter)
{
paramStatsCounter = paramStatsCounter.snapshot();
this.a.a(paramStatsCounter.hitCount());
this.b.a(paramStatsCounter.missCount());
this.c.a(paramStatsCounter.loadSuccessCount());
this.d.a(paramStatsCounter.loadExceptionCount());
this.e.a(paramStatsCounter.totalLoadTime());
this.f.a(paramStatsCounter.evictionCount());
}
public final void recordEviction()
{
this.f.a();
}
public final void recordHits(int paramInt)
{
this.a.a(paramInt);
}
public final void recordLoadException(long paramLong)
{
this.d.a();
this.e.a(paramLong);
}
public final void recordLoadSuccess(long paramLong)
{
this.c.a();
this.e.a(paramLong);
}
public final void recordMisses(int paramInt)
{
this.b.a(paramInt);
}
public final CacheStats snapshot()
{
return new CacheStats(this.a.b(), this.b.b(), this.c.b(), this.d.b(), this.e.b(), this.f.b());
}
}
@Beta
public static abstract interface StatsCounter
{
public abstract void recordEviction();
public abstract void recordHits(int paramInt);
public abstract void recordLoadException(long paramLong);
public abstract void recordLoadSuccess(long paramLong);
public abstract void recordMisses(int paramInt);
public abstract CacheStats snapshot();
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/cache/AbstractCache.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/