-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCriminal.java
More file actions
42 lines (32 loc) · 765 Bytes
/
Criminal.java
File metadata and controls
42 lines (32 loc) · 765 Bytes
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
package jtest.com.baidu;
import java.util.Random;
/**
* Created by YAO on 2017/2/28.
*/
public class Criminal {
private int id; // 编号按照时间从小到大 time
private int value; // 犯罪值 extent
Criminal(int id, int CriminalNumber) {
this.id = id;
this.value = estimateExtent(CriminalNumber);
}
private int estimateExtent(int CriminalNumber) {
int max = CriminalNumber;
int min = 1;
Random random = new Random();
int s = random.nextInt(max) % (max - min + 1) + min;
return s;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getValue() {
return value;
}
public void setValue(Integer value) {
this.value = value;
}
}