Methods Summary |
---|
public boolean | fitsIn16Bits()Returns true if this value can fit in 16 bits with sign-extension.
if (! fitsInInt()) {
return false;
}
int bits = getIntBits();
return (short) bits == bits;
|
public boolean | fitsIn8Bits()Returns true if this value can fit in 8 bits with sign-extension.
if (! fitsInInt()) {
return false;
}
int bits = getIntBits();
return (byte) bits == bits;
|
public abstract boolean | fitsInInt()Returns whether or not this instance's value may be accurately
represented as an {@code int}. The rule is that if there
is an {@code int} which may be sign-extended to yield this
instance's value, then this method returns {@code true}.
Otherwise, it returns {@code false}.
|
public abstract int | getIntBits()Gets the value as {@code int} bits. If this instance contains
more bits than fit in an {@code int}, then this returns only
the low-order bits.
|
public abstract long | getLongBits()Gets the value as {@code long} bits. If this instance contains
fewer bits than fit in a {@code long}, then the result of this
method is the sign extension of the value.
|