RandomUtils.java
3.77 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
package org.apache.commons.lang3;
import java.util.Random;
public class RandomUtils
{
private static final Random a = new Random();
public static boolean nextBoolean()
{
return a.nextBoolean();
}
public static byte[] nextBytes(int paramInt)
{
if (paramInt >= 0) {}
for (boolean bool = true;; bool = false)
{
Validate.isTrue(bool, "Count cannot be negative.", new Object[0]);
byte[] arrayOfByte = new byte[paramInt];
a.nextBytes(arrayOfByte);
return arrayOfByte;
}
}
public static double nextDouble()
{
return nextDouble(0.0D, Double.MAX_VALUE);
}
public static double nextDouble(double paramDouble1, double paramDouble2)
{
boolean bool2 = true;
if (paramDouble2 >= paramDouble1)
{
bool1 = true;
Validate.isTrue(bool1, "Start value must be smaller or equal to end value.", new Object[0]);
if (paramDouble1 < 0.0D) {
break label58;
}
}
label58:
for (boolean bool1 = bool2;; bool1 = false)
{
Validate.isTrue(bool1, "Both range values must be non-negative.", new Object[0]);
if (paramDouble1 != paramDouble2) {
break label64;
}
return paramDouble1;
bool1 = false;
break;
}
label64:
return paramDouble1 + (paramDouble2 - paramDouble1) * a.nextDouble();
}
public static float nextFloat()
{
return nextFloat(0.0F, Float.MAX_VALUE);
}
public static float nextFloat(float paramFloat1, float paramFloat2)
{
boolean bool2 = true;
if (paramFloat2 >= paramFloat1)
{
bool1 = true;
Validate.isTrue(bool1, "Start value must be smaller or equal to end value.", new Object[0]);
if (paramFloat1 < 0.0F) {
break label51;
}
}
label51:
for (boolean bool1 = bool2;; bool1 = false)
{
Validate.isTrue(bool1, "Both range values must be non-negative.", new Object[0]);
if (paramFloat1 != paramFloat2) {
break label56;
}
return paramFloat1;
bool1 = false;
break;
}
label56:
return paramFloat1 + (paramFloat2 - paramFloat1) * a.nextFloat();
}
public static int nextInt()
{
return nextInt(0, Integer.MAX_VALUE);
}
public static int nextInt(int paramInt1, int paramInt2)
{
boolean bool2 = true;
if (paramInt2 >= paramInt1)
{
bool1 = true;
Validate.isTrue(bool1, "Start value must be smaller or equal to end value.", new Object[0]);
if (paramInt1 < 0) {
break label47;
}
}
label47:
for (boolean bool1 = bool2;; bool1 = false)
{
Validate.isTrue(bool1, "Both range values must be non-negative.", new Object[0]);
if (paramInt1 != paramInt2) {
break label52;
}
return paramInt1;
bool1 = false;
break;
}
label52:
return paramInt1 + a.nextInt(paramInt2 - paramInt1);
}
public static long nextLong()
{
return nextLong(0L, Long.MAX_VALUE);
}
public static long nextLong(long paramLong1, long paramLong2)
{
boolean bool2 = true;
if (paramLong2 >= paramLong1)
{
bool1 = true;
Validate.isTrue(bool1, "Start value must be smaller or equal to end value.", new Object[0]);
if (paramLong1 < 0L) {
break label58;
}
}
label58:
for (boolean bool1 = bool2;; bool1 = false)
{
Validate.isTrue(bool1, "Both range values must be non-negative.", new Object[0]);
if (paramLong1 != paramLong2) {
break label64;
}
return paramLong1;
bool1 = false;
break;
}
label64:
return nextDouble(paramLong1, paramLong2);
}
}
/* Location: /home/merong/decompile/hackery-dex2jar.jar!/org/apache/commons/lang3/RandomUtils.class
* Java compiler version: 6 (50.0)
* JD-Core Version: 0.7.1
*/