mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
add static hashCode(i) method like in java.lang.Integer
This commit is contained in:
parent
5ee332c771
commit
0639acca21
|
@ -42,6 +42,10 @@ public class TInteger extends TNumber implements TComparable<TInteger> {
|
||||||
return new TAbstractStringBuilder(20).append(i, radix).toString();
|
return new TAbstractStringBuilder(20).append(i, radix).toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static int hashCode(int value) {
|
||||||
|
return (value >>> 4) ^ (value << 28) ^ (value << 8) ^ (value >>> 24);
|
||||||
|
}
|
||||||
|
|
||||||
public static String toHexString(int i) {
|
public static String toHexString(int i) {
|
||||||
return toUnsignedLogRadixString(i, 4);
|
return toUnsignedLogRadixString(i, 4);
|
||||||
}
|
}
|
||||||
|
@ -156,7 +160,7 @@ public class TInteger extends TNumber implements TComparable<TInteger> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
return (value >>> 4) ^ (value << 28) ^ (value << 8) ^ (value >>> 24);
|
return TInteger.hashCode(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue
Block a user