od.java
1.94 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
import com.google.common.annotations.GwtCompatible;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableMap.Builder;
import com.google.common.collect.Ordering;
import com.google.common.collect.Ordering.c;
import java.io.Serializable;
import java.util.Iterator;
import java.util.List;
import javax.annotation.Nullable;
@GwtCompatible(serializable=true)
public final class od<T>
extends Ordering<T>
implements Serializable
{
private static final long serialVersionUID = 0L;
final ImmutableMap<T, Integer> a;
private od(ImmutableMap<T, Integer> paramImmutableMap)
{
this.a = paramImmutableMap;
}
public od(List<T> paramList)
{
this(a(paramList));
}
private int a(T paramT)
{
Integer localInteger = (Integer)this.a.get(paramT);
if (localInteger == null) {
throw new Ordering.c(paramT);
}
return localInteger.intValue();
}
private static <T> ImmutableMap<T, Integer> a(List<T> paramList)
{
ImmutableMap.Builder localBuilder = ImmutableMap.builder();
int i = 0;
paramList = paramList.iterator();
while (paramList.hasNext())
{
localBuilder.put(paramList.next(), Integer.valueOf(i));
i += 1;
}
return localBuilder.build();
}
public final int compare(T paramT1, T paramT2)
{
return a(paramT1) - a(paramT2);
}
public final boolean equals(@Nullable Object paramObject)
{
if ((paramObject instanceof od))
{
paramObject = (od)paramObject;
return this.a.equals(((od)paramObject).a);
}
return false;
}
public final int hashCode()
{
return this.a.hashCode();
}
public final String toString()
{
String str = String.valueOf(String.valueOf(this.a.keySet()));
return str.length() + 19 + "Ordering.explicit(" + str + ")";
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/od.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/