UnsignedInteger.java
4.41 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
package com.google.common.primitives;
import com.google.common.annotations.GwtCompatible;
import com.google.common.annotations.GwtIncompatible;
import com.google.common.base.Preconditions;
import java.math.BigInteger;
import javax.annotation.CheckReturnValue;
import javax.annotation.Nullable;
@GwtCompatible(emulated=true)
public final class UnsignedInteger
extends Number
implements Comparable<UnsignedInteger>
{
public static final UnsignedInteger MAX_VALUE = fromIntBits(-1);
public static final UnsignedInteger ONE;
public static final UnsignedInteger ZERO = fromIntBits(0);
private final int a;
static
{
ONE = fromIntBits(1);
}
private UnsignedInteger(int paramInt)
{
this.a = (paramInt & 0xFFFFFFFF);
}
public static UnsignedInteger fromIntBits(int paramInt)
{
return new UnsignedInteger(paramInt);
}
public static UnsignedInteger valueOf(long paramLong)
{
if ((0xFFFFFFFF & paramLong) == paramLong) {}
for (boolean bool = true;; bool = false)
{
Preconditions.checkArgument(bool, "value (%s) is outside the range for an unsigned integer value", new Object[] { Long.valueOf(paramLong) });
return fromIntBits((int)paramLong);
}
}
public static UnsignedInteger valueOf(String paramString)
{
return valueOf(paramString, 10);
}
public static UnsignedInteger valueOf(String paramString, int paramInt)
{
return fromIntBits(UnsignedInts.parseUnsignedInt(paramString, paramInt));
}
public static UnsignedInteger valueOf(BigInteger paramBigInteger)
{
Preconditions.checkNotNull(paramBigInteger);
if ((paramBigInteger.signum() >= 0) && (paramBigInteger.bitLength() <= 32)) {}
for (boolean bool = true;; bool = false)
{
Preconditions.checkArgument(bool, "value (%s) is outside the range for an unsigned integer value", new Object[] { paramBigInteger });
return fromIntBits(paramBigInteger.intValue());
}
}
public final BigInteger bigIntegerValue()
{
return BigInteger.valueOf(longValue());
}
public final int compareTo(UnsignedInteger paramUnsignedInteger)
{
Preconditions.checkNotNull(paramUnsignedInteger);
return UnsignedInts.compare(this.a, paramUnsignedInteger.a);
}
@CheckReturnValue
public final UnsignedInteger dividedBy(UnsignedInteger paramUnsignedInteger)
{
return fromIntBits(UnsignedInts.divide(this.a, ((UnsignedInteger)Preconditions.checkNotNull(paramUnsignedInteger)).a));
}
public final double doubleValue()
{
return longValue();
}
public final boolean equals(@Nullable Object paramObject)
{
boolean bool2 = false;
boolean bool1 = bool2;
if ((paramObject instanceof UnsignedInteger))
{
paramObject = (UnsignedInteger)paramObject;
bool1 = bool2;
if (this.a == ((UnsignedInteger)paramObject).a) {
bool1 = true;
}
}
return bool1;
}
public final float floatValue()
{
return (float)longValue();
}
public final int hashCode()
{
return this.a;
}
public final int intValue()
{
return this.a;
}
public final long longValue()
{
return UnsignedInts.toLong(this.a);
}
@CheckReturnValue
public final UnsignedInteger minus(UnsignedInteger paramUnsignedInteger)
{
return fromIntBits(this.a - ((UnsignedInteger)Preconditions.checkNotNull(paramUnsignedInteger)).a);
}
@CheckReturnValue
public final UnsignedInteger mod(UnsignedInteger paramUnsignedInteger)
{
return fromIntBits(UnsignedInts.remainder(this.a, ((UnsignedInteger)Preconditions.checkNotNull(paramUnsignedInteger)).a));
}
@CheckReturnValue
public final UnsignedInteger plus(UnsignedInteger paramUnsignedInteger)
{
int i = this.a;
return fromIntBits(((UnsignedInteger)Preconditions.checkNotNull(paramUnsignedInteger)).a + i);
}
@CheckReturnValue
@GwtIncompatible("Does not truncate correctly")
public final UnsignedInteger times(UnsignedInteger paramUnsignedInteger)
{
int i = this.a;
return fromIntBits(((UnsignedInteger)Preconditions.checkNotNull(paramUnsignedInteger)).a * i);
}
public final String toString()
{
return toString(10);
}
public final String toString(int paramInt)
{
return UnsignedInts.toString(this.a, paramInt);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/com/google/common/primitives/UnsignedInteger.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/