1 package com.puppycrawl.tools.checkstyle.checks.indentation.indentation;
2
3 import java.util.AbstractMap;
4 import java.util.List;
5 import java.util.Set;
6 import java.util.concurrent.ConcurrentMap;
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 class InputIndentationFromGuava<K, V> extends AbstractMap<K, V>
25 implements ConcurrentMap<K, V> {
26
27 enum Strength {
28
29
30
31
32
33 STRONG {
34 <K, V> Object referenceValue(
35 Segment<K, V> s, ReferenceEntry<K, V> entry, int value, int weight) {
36 return (weight == 1)
37 ? new StrongValueReference<K, V>(value)
38 : new WeightedStrongValueReference<K, V>(value, weight);
39 }
40
41 @Override
42 List<Object> defaultEquivalence() {
43 return new java.util.ArrayList<>();
44 }
45
46 @Override
47 <K, V> ValueReference<K, V> referenceValue(Segment<K, V> segment,
48 ReferenceEntry<K, V> entry, V value, int weight) {
49
50 return null;
51 }
52 },
53
54 SOFT {
55 <K, V> Object referenceValue1(
56 Segment<K, V> s, ReferenceEntry<Integer, Integer> en,int va,int we){
57 return (we == 1)
58 ? new SoftValueReference<K, V>(s.valueReferenceQueue, va, en)
59 : new WeightedSoftValueReference<K, V>();
60 }
61
62 @Override
63 List<Object> defaultEquivalence() {
64 return new java.util.ArrayList<>();
65 }
66
67 @Override <K,V> Object referenceValue(Segment<K,V> s, ReferenceEntry<K, V> e,
68 V value, int weight)
69 {
70 return null;
71 }
72 },
73
74 WEAK {
75 @Override
76 <K, V> Object referenceValue(
77 Segment<K, V> seg, ReferenceEntry<K, V> entry, V value, int weight) {
78 return (weight == 1)
79 ? new WeakValueReference<K, V>()
80 : new WeightedWeakValueReference<K, V>();
81 }
82
83 @Override
84 List<Object> defaultEquivalence() {
85 return new java.util.ArrayList<>();
86 }
87 };
88
89
90
91
92 abstract <K, V> Object referenceValue(
93 Segment<K, V> segment, ReferenceEntry<K, V> entry, V value, int weight);
94
95
96
97
98
99
100 abstract List<Object> defaultEquivalence();
101 }
102
103
104
105
106 enum EntryFactory {
107 STRONG {
108 <K, V> StrongEntry<K, V> newEntry(
109 Segment<K, V> s, K k, int h, @XmlElement ReferenceEntry<K, V> next) {
110 return new StrongEntry<K, V>();
111 }
112 },
113 STRONG_ACCESS {
114 <K, V> StrongAccessEntry<K, V> newEntry(
115 Segment<K, V> s, K k, int h, @XmlElement ReferenceEntry<K, V> next) {
116 return new StrongAccessEntry<K, V>(k, h, next);
117 }
118
119 <K, V> ReferenceEntry<K, V> copyEntry(
120 Segment<K, V> s, ReferenceEntry<K, V> o, ReferenceEntry<K, V> newT) {
121 return newT;
122 }
123 {;
124 }
125 },
126 STRONG_WRITE {
127 <K, V> StrongEntry<K, V> newEntry(
128 Segment<K, V> s, K k, int h, @XmlElement ReferenceEntry<K, V> next) {
129 return new StrongEntry<K, V>();
130 }
131
132 <K, V> ReferenceEntry<K, V> copyEntry(
133 Segment<K, V> s, ReferenceEntry<K, V> o, ReferenceEntry<K, V> newN) {
134 return newN;
135 }
136 },
137 STRONG_ACCESS_WRITE {
138 <K, V> StrongEntry<K, V> newEntry(
139 Segment<K, V> s, K k, int h, @XmlElement ReferenceEntry<K, V> next) {
140 return new StrongEntry<K, V>();
141 }
142
143 <K, V> ReferenceEntry<K, V> copyEntry(
144 Segment<K, V> s, ReferenceEntry<K, V> o, ReferenceEntry<K, V> newN) {
145 return newN;
146 }
147 },
148
149 WEAK {
150 <K, V> StrongEntry<K, V> newEntry(
151 Segment<K, V> s, K k, int h, @XmlElement ReferenceEntry<K, V> next) {
152 return new StrongEntry<K, V>();
153 }
154 },
155 WEAK_ACCESS {
156 <K, V> StrongEntry<K, V> newEntry(
157 Segment<K, V> s, K k, int h, @XmlElement ReferenceEntry<K, V> next) {
158 return new StrongEntry<K, V>();
159 }
160
161 <K, V> ReferenceEntry<K, V> copyEntry(
162 Segment<K, V> s, ReferenceEntry<K, V> o, ReferenceEntry<K, V> newN) {
163 return newN;
164 }
165 },
166 WEAK_WRITE {
167 <K, V> StrongEntry<K, V> newEntry(
168 Segment<K, V> s, K k, int h, @XmlElement ReferenceEntry<K, V> next) {
169 return new StrongEntry<K, V>();
170 }
171
172 <K, V> ReferenceEntry<K, V> copyEntry(
173 Segment<K, V> s, ReferenceEntry<K, V> o, ReferenceEntry<K, V> newN) {
174 return newN;
175 }
176 },
177 WEAK_ACCESS_WRITE {
178 <K, V> StrongEntry<K, V> newEntry(
179 Segment<K, V> s, K k, int h, @XmlElement ReferenceEntry<K, V> next) {
180 return new StrongEntry<K, V>();
181 }
182
183 <K, V> ReferenceEntry<K, V> copyEntry(
184 Segment<K, V> s, ReferenceEntry<K, V> o, ReferenceEntry<K, V> newN) {
185 return newN;
186 }
187 };
188 }
189
190 @Override
191 public Set<java.util.Map.Entry<K, V>> entrySet()
192 {
193 return null;
194 }
195
196 @Override
197 public V putIfAbsent(K key, V value)
198 {
199 return null;
200 }
201
202 @Override
203 public boolean remove(Object key, Object value)
204 {
205 return false;
206 }
207
208 @Override
209 public boolean replace(K key, V oldValue, V newValue)
210 {
211 return false;
212 }
213
214 @Override
215 public V replace(K key, V value)
216 {
217 return null;
218 }
219
220 private static class ValueReference<T1, T2> {
221
222 }
223
224 private static class ReferenceEntry<T1, T2> {
225
226 }
227
228 private static class Segment<T1, T2> {
229
230 protected Object valueReferenceQueue;
231
232 }
233
234 private static class StrongAccessEntry<T1, T2> {
235
236 public StrongAccessEntry(T1 key, int hash, ReferenceEntry<T1, T2> next)
237 {
238
239 }
240
241 }
242
243 private static class StrongValueReference<T1, T2> {
244
245 public StrongValueReference(int value)
246 {
247
248 }
249
250 }
251
252 private static class WeightedStrongValueReference<T1, T2> {
253
254 public WeightedStrongValueReference(int value, int weight)
255 {
256
257 }
258
259 }
260
261 private static class SoftValueReference<T1, T2> {
262
263 public SoftValueReference(Object valueReferenceQueue, int value,
264 ReferenceEntry<Integer, Integer> entry)
265 {
266
267 }
268
269 }
270
271 private static class WeightedSoftValueReference<T1, T2> {
272
273 }
274
275 private static class WeakValueReference<T1, T2> {
276
277 }
278
279 private static class WeightedWeakValueReference<T1, T2> {
280
281 }
282
283 private static class StrongEntry<T1, T2> {
284
285 }
286
287 public @interface XmlElement {
288 }
289
290 }