TreeBasedTable.java
6.09 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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
package com.google.common.collect;
import com.google.common.annotations.Beta;
import com.google.common.annotations.GwtCompatible;
import com.google.common.base.Function;
import com.google.common.base.Preconditions;
import com.google.common.base.Supplier;
import java.io.Serializable;
import java.util.Comparator;
import java.util.Iterator;
import java.util.Map;
import java.util.NoSuchElementException;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TreeMap;
import javax.annotation.Nullable;
import qd;
import qe;
import qe.f;
@Beta
@GwtCompatible(serializable=true)
public class TreeBasedTable<R, C, V>
extends qd<R, C, V>
{
private static final long serialVersionUID = 0L;
private final Comparator<? super C> c;
private TreeBasedTable(Comparator<? super R> paramComparator, Comparator<? super C> paramComparator1)
{
super(new TreeMap(paramComparator), new a(paramComparator1));
this.c = paramComparator1;
}
public static <R extends Comparable, C extends Comparable, V> TreeBasedTable<R, C, V> create()
{
return new TreeBasedTable(Ordering.natural(), Ordering.natural());
}
public static <R, C, V> TreeBasedTable<R, C, V> create(TreeBasedTable<R, C, ? extends V> paramTreeBasedTable)
{
TreeBasedTable localTreeBasedTable = new TreeBasedTable(paramTreeBasedTable.rowComparator(), paramTreeBasedTable.columnComparator());
localTreeBasedTable.putAll(paramTreeBasedTable);
return localTreeBasedTable;
}
public static <R, C, V> TreeBasedTable<R, C, V> create(Comparator<? super R> paramComparator, Comparator<? super C> paramComparator1)
{
Preconditions.checkNotNull(paramComparator);
Preconditions.checkNotNull(paramComparator1);
return new TreeBasedTable(paramComparator, paramComparator1);
}
public Comparator<? super C> columnComparator()
{
return this.c;
}
final Iterator<C> f()
{
final Comparator localComparator = columnComparator();
new AbstractIterator() {}
{
C a;
protected final C computeNext()
{
if (this.b.hasNext())
{
Object localObject = this.b.next();
if ((this.a != null) && (localComparator.compare(localObject, this.a) == 0)) {}
for (int i = 1; i == 0; i = 0)
{
this.a = localObject;
return (C)this.a;
}
}
this.a = null;
return (C)endOfData();
}
};
}
public SortedMap<C, V> row(R paramR)
{
return new b(paramR);
}
public Comparator<? super R> rowComparator()
{
return rowKeySet().comparator();
}
public SortedSet<R> rowKeySet()
{
return super.rowKeySet();
}
public SortedMap<R, Map<C, V>> rowMap()
{
return super.rowMap();
}
static final class a<C, V>
implements Supplier<TreeMap<C, V>>, Serializable
{
private static final long serialVersionUID = 0L;
final Comparator<? super C> a;
a(Comparator<? super C> paramComparator)
{
this.a = paramComparator;
}
}
final class b
extends qe<R, C, V>.f
implements SortedMap<C, V>
{
@Nullable
final C d;
@Nullable
final C e;
transient SortedMap<C, V> f;
b()
{
this(localObject, null, null);
}
private b(C paramC1, @Nullable C paramC2)
{
super(paramC1);
this.d = paramC2;
Object localObject;
this.e = localObject;
if ((paramC2 == null) || (localObject == null) || (a(paramC2, localObject) <= 0)) {}
for (boolean bool = true;; bool = false)
{
Preconditions.checkArgument(bool);
return;
}
}
private int a(Object paramObject1, Object paramObject2)
{
return comparator().compare(paramObject1, paramObject2);
}
private boolean a(@Nullable Object paramObject)
{
return (paramObject != null) && ((this.d == null) || (a(this.d, paramObject) <= 0)) && ((this.e == null) || (a(this.e, paramObject) > 0));
}
private SortedMap<C, V> g()
{
if ((this.f == null) || ((this.f.isEmpty()) && (TreeBasedTable.this.a.containsKey(this.a)))) {
this.f = ((SortedMap)TreeBasedTable.this.a.get(this.a));
}
return this.f;
}
public final Comparator<? super C> comparator()
{
return TreeBasedTable.this.columnComparator();
}
public final boolean containsKey(Object paramObject)
{
return (a(paramObject)) && (super.containsKey(paramObject));
}
final void f()
{
if ((g() != null) && (this.f.isEmpty()))
{
TreeBasedTable.this.a.remove(this.a);
this.f = null;
this.b = null;
}
}
public final C firstKey()
{
if ((SortedMap)super.c() == null) {
throw new NoSuchElementException();
}
return (C)((SortedMap)super.c()).firstKey();
}
public final SortedMap<C, V> headMap(C paramC)
{
Preconditions.checkArgument(a(Preconditions.checkNotNull(paramC)));
return new b(TreeBasedTable.this, this.a, this.d, paramC);
}
public final C lastKey()
{
if ((SortedMap)super.c() == null) {
throw new NoSuchElementException();
}
return (C)((SortedMap)super.c()).lastKey();
}
public final V put(C paramC, V paramV)
{
Preconditions.checkArgument(a(Preconditions.checkNotNull(paramC)));
return (V)super.put(paramC, paramV);
}
public final SortedMap<C, V> subMap(C paramC1, C paramC2)
{
if ((a(Preconditions.checkNotNull(paramC1))) && (a(Preconditions.checkNotNull(paramC2)))) {}
for (boolean bool = true;; bool = false)
{
Preconditions.checkArgument(bool);
return new b(TreeBasedTable.this, this.a, paramC1, paramC2);
}
}
public final SortedMap<C, V> tailMap(C paramC)
{
Preconditions.checkArgument(a(Preconditions.checkNotNull(paramC)));
return new b(TreeBasedTable.this, this.a, paramC, this.e);
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/collect/TreeBasedTable.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/