-
Notifications
You must be signed in to change notification settings - Fork 0
/
LongTag.java
47 lines (38 loc) · 887 Bytes
/
LongTag.java
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
package io.github.ensgijs.nbt.tag;
public class LongTag extends NumberTag<Long> implements Comparable<LongTag> {
public static final byte ID = 4;
public static final long ZERO_VALUE = 0L;
public LongTag() {
super(ZERO_VALUE);
}
public LongTag(long value) {
super(value);
}
/** {@inheritDoc} */
@Override
public byte getID() {
return ID;
}
/**
* Sets the value for this Tag directly.
* @param value The value to be set.
*/
public void setValue(long value) {
super.setValue(value);
}
/** {@inheritDoc} */
@Override
public boolean equals(Object other) {
return super.equals(other) && asLong() == ((LongTag) other).asLong();
}
/** {@inheritDoc} */
@Override
public int compareTo(LongTag other) {
return getValue().compareTo(other.getValue());
}
/** {@inheritDoc} */
@Override
public LongTag clone() {
return new LongTag(getValue());
}
}