Pools.java
1.95 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
package android.support.v4.util;
public final class Pools
{
public static abstract interface Pool<T>
{
public abstract T acquire();
public abstract boolean release(T paramT);
}
public static class SimplePool<T>
implements Pools.Pool<T>
{
private final Object[] a;
private int b;
public SimplePool(int paramInt)
{
if (paramInt <= 0) {
throw new IllegalArgumentException("The max pool size must be > 0");
}
this.a = new Object[paramInt];
}
public T acquire()
{
if (this.b > 0)
{
int i = this.b - 1;
Object localObject = this.a[i];
this.a[i] = null;
this.b -= 1;
return (T)localObject;
}
return null;
}
public boolean release(T paramT)
{
boolean bool = false;
int i = 0;
if (i < this.b) {
if (this.a[i] != paramT) {}
}
for (i = 1;; i = 0)
{
if (i == 0) {
break label50;
}
throw new IllegalStateException("Already in the pool!");
i += 1;
break;
}
label50:
if (this.b < this.a.length)
{
this.a[this.b] = paramT;
this.b += 1;
bool = true;
}
return bool;
}
}
public static class SynchronizedPool<T>
extends Pools.SimplePool<T>
{
private final Object a = new Object();
public SynchronizedPool(int paramInt)
{
super();
}
public T acquire()
{
synchronized (this.a)
{
Object localObject2 = super.acquire();
return (T)localObject2;
}
}
public boolean release(T paramT)
{
synchronized (this.a)
{
boolean bool = super.release(paramT);
return bool;
}
}
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/android/support/v4/util/Pools.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/