mirror of
https://github.com/corda/corda.git
synced 2025-06-13 12:48:18 +00:00
make Boolean, Byte, Short, etc. implement Comparable
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
package java.lang;
|
||||
|
||||
public final class Short extends Number {
|
||||
public final class Short extends Number implements Comparable<Short> {
|
||||
public static final Class TYPE = Class.forCanonicalName("S");
|
||||
public static final short MAX_VALUE = 32767;
|
||||
|
||||
@ -14,6 +14,10 @@ public final class Short extends Number {
|
||||
return new Short(value);
|
||||
}
|
||||
|
||||
public int compareTo(Short o) {
|
||||
return value - o.value;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
return o instanceof Short && ((Short) o).value == value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user