|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
net.ajaest.lib.data.UByte
public class UByte
The UByte
class wraps a value of primitive type byte
in an
object and provides several methods to manipulate it as unsigned byte number.
The use of this class is preferred for storing purposes.
Number
,
Byte
,
Serialized FormField Summary | |
---|---|
static UByte |
MAX_VALUE
|
static UByte |
MIN_VALUE
|
private static long |
serialVersionUID
|
private byte |
value
|
Constructor Summary | |
---|---|
UByte(byte b)
|
|
UByte(int ui)
|
|
UByte(java.lang.String s)
|
Method Summary | |
---|---|
UByte |
add(UByte val)
Returns a UByte whose value is (this + val) . |
byte |
byteValue()
|
int |
compareTo(UByte o)
|
UByte |
divide(UByte val)
Returns a UByte whose value is (this / val) . |
double |
doubleValue()
|
boolean |
equals(java.lang.Object obj)
|
float |
floatValue()
|
UByte |
gcd(UByte val)
Returns a UByte whose value is the greatest common divisor of abs(this) and abs(val) . |
int |
hashCode()
|
int |
intValue()
|
long |
longValue()
|
UByte |
mod(UByte m)
Returns a UByte whose value is (this mod m ). |
UByte |
multiply(UByte val)
Returns a UByte whose value is (this * val) . |
UByte |
pow(int exponent)
Returns a UByte whose value is (thisexponent). |
UByte |
square()
Returns a UByte whose value is (this<sup>2</sup>) . |
UByte |
subtract(UByte val)
Returns a UByte whose value is abs(this - val) . |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Number |
---|
shortValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private byte value
public static final UByte MIN_VALUE
public static final UByte MAX_VALUE
Constructor Detail |
---|
public UByte(byte b)
public UByte(int ui)
public UByte(java.lang.String s)
Method Detail |
---|
public UByte add(UByte val)
(this + val)
.
val
- value to be added to this UByte.
this + val
public UByte subtract(UByte val)
abs(this - val)
.
val
- value to be subtracted from this UByte.
this - val
public UByte multiply(UByte val)
(this * val)
.
val
- value to be multiplied by this UByte.
this * val
public UByte square()
(this<sup>2</sup>)
.
this<sup>2</sup>
public UByte divide(UByte val)
(this / val)
.
val
- value by which this UByte is to be divided.
this / val
java.lang.ArithmeticException
- val==0
public UByte mod(UByte m)
(this mod m
).
m
- the modulus.
this mod m
public UByte pow(int exponent)
exponent
is an integer rather than a UByte.
exponent
- exponent to which this UByte is to be raised.
java.lang.ArithmeticException
- exponent
is negative. (This would cause the operation
to yield a non-integer value.)public UByte gcd(UByte val)
abs(this)
and abs(val)
. Returns 0 if val==0
.
val
- value with which the GCD is to be computed.
GCD(this, val)
public byte byteValue()
byteValue
in class java.lang.Number
public double doubleValue()
doubleValue
in class java.lang.Number
public float floatValue()
floatValue
in class java.lang.Number
public int intValue()
intValue
in class java.lang.Number
public long longValue()
longValue
in class java.lang.Number
public int compareTo(UByte o)
compareTo
in interface java.lang.Comparable<UByte>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |