forked from fast-pack/JavaFastPFOR
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIntWrapper.java
More file actions
64 lines (51 loc) · 1.04 KB
/
Copy pathIntWrapper.java
File metadata and controls
64 lines (51 loc) · 1.04 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
/**
* This code is released under the
* Apache License Version 2.0 http://www.apache.org/licenses/.
*
*/
package me.lemire.integercompression;
/**
* @author dwu
*/
public final class IntWrapper extends Number {
private static final long serialVersionUID = 1L;
private int value;
public IntWrapper() {
this(0);
}
public IntWrapper(int v) {
this.value = v;
}
public void add(int v) {
this.value += v;
}
@Override
public double doubleValue() {
return this.value;
}
@Override
public float floatValue() {
return this.value;
}
public int get() {
return this.value;
}
public void increment() {
this.value++;
}
@Override
public int intValue() {
return this.value;
}
@Override
public long longValue() {
return this.value;
}
public void set(int value) {
this.value = value;
}
@Override
public String toString() {
return Integer.toString(this.value);
}
}