2007-07-20 03:18:25 +00:00
|
|
|
package java.lang;
|
|
|
|
|
2007-07-21 17:50:26 +00:00
|
|
|
public final class Byte extends Number {
|
2007-07-28 16:55:24 +00:00
|
|
|
public static final Class TYPE = Class.forCanonicalName("B");
|
2007-07-27 02:39:53 +00:00
|
|
|
|
2007-07-20 03:18:25 +00:00
|
|
|
private final byte value;
|
|
|
|
|
|
|
|
public Byte(byte value) {
|
|
|
|
this.value = value;
|
|
|
|
}
|
|
|
|
|
2007-08-13 00:50:25 +00:00
|
|
|
public static Byte valueOf(byte value) {
|
|
|
|
return new Byte(value);
|
|
|
|
}
|
|
|
|
|
2007-07-29 23:32:23 +00:00
|
|
|
public boolean equals(Object o) {
|
|
|
|
return o instanceof Byte && ((Byte) o).value == value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int hashCode() {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public String toString() {
|
|
|
|
return toString(value);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String toString(byte v, int radix) {
|
|
|
|
return Long.toString(v, radix);
|
|
|
|
}
|
|
|
|
|
|
|
|
public static String toString(byte v) {
|
|
|
|
return toString(v, 10);
|
|
|
|
}
|
|
|
|
|
2007-07-20 03:18:25 +00:00
|
|
|
public byte byteValue() {
|
|
|
|
return value;
|
|
|
|
}
|
2007-07-21 17:50:26 +00:00
|
|
|
|
|
|
|
public short shortValue() {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public int intValue() {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public long longValue() {
|
|
|
|
return value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public float floatValue() {
|
|
|
|
return (float) value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public double doubleValue() {
|
|
|
|
return (double) value;
|
|
|
|
}
|
2007-07-20 03:18:25 +00:00
|
|
|
}
|