|
JScience v4.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.lang.Number
org.jscience.mathematics.number.Number<T>
public abstract class Number<T extends Number<T>>
This class represents a value-type
number.
| Constructor Summary | |
|---|---|
Number()
|
|
| Method Summary | |
|---|---|
byte |
byteValue()
Returns the value of this number as a byte. |
abstract int |
compareTo(T that)
Compares this number with the specified number for order. |
abstract Number<T> |
copy()
Returns a copy of this number allocated
by the calling thread (possibly on the stack). |
abstract double |
doubleValue()
Returns the value of this number as a double. |
abstract boolean |
equals(java.lang.Object obj)
Indicates if this number is equals to the specified object. |
float |
floatValue()
Returns the value of this number as a float. |
abstract int |
hashCode()
Returns the hash code for this number (consistent with equals(Object). |
int |
intValue()
Returns the value of this number as an int. |
boolean |
isGreaterThan(T that)
Indicates if this number is ordered after that number (convenience method). |
abstract boolean |
isLargerThan(T that)
Compares the magnitude of this number with that number. |
boolean |
isLessThan(T that)
Indicates if this number is ordered before that number (convenience method). |
abstract long |
longValue()
Returns the value of this number as a long. |
T |
minus(T that)
Returns the difference between this number and the one specified. |
T |
pow(int exp)
Returns this number raised at the specified positive exponent. |
short |
shortValue()
Returns the value of this number as a short. |
java.lang.String |
toString()
Returns the text representation of this number as a java.lang.String. |
abstract Text |
toText()
Returns the textual representation of this real-time object (equivalent to toString except that the returned value
can be allocated from the local context space). |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.jscience.mathematics.structure.Ring |
|---|
times |
| Methods inherited from interface org.jscience.mathematics.structure.GroupAdditive |
|---|
opposite, plus |
| Constructor Detail |
|---|
public Number()
| Method Detail |
|---|
public abstract boolean isLargerThan(T that)
|this| > |that|public abstract long longValue()
long.
longValue in class java.lang.Numberlong.public abstract double doubleValue()
double.
doubleValue in class java.lang.Numberdouble.public abstract int compareTo(T that)
(x.compareTo(y)==0) == (x.equals(y)),
compareTo in interface java.lang.Comparable<T extends Number<T>>that - the number to be compared.
public final boolean isLessThan(T that)
that - the number to compare with.
this.compareTo(that) < 0.public final boolean isGreaterThan(T that)
that - the number to compare with.
this.compareTo(that) > 0.public T minus(T that)
that - the number to be subtracted.
this - that.public T pow(int exp)
exp - the positive exponent.
thisexp
java.lang.IllegalArgumentException - if exp <= 0public final byte byteValue()
byte.
This may involve rounding or truncation.
byteValue in class java.lang.Numberbyte.public final short shortValue()
short.
This may involve rounding or truncation.
shortValue in class java.lang.Numbershort.public final int intValue()
int.
This may involve rounding or truncation.
intValue in class java.lang.Numberint.public final float floatValue()
float.
This may involve rounding.
floatValue in class java.lang.Numberfloat.public abstract boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object to be compared with.
true if this number and the specified argument
represent the same number; false otherwise.public abstract int hashCode()
equals(Object).
hashCode in class java.lang.Objectpublic abstract Text toText()
toString except that the returned value
can be allocated from the local context space).
toText in interface Realtimepublic abstract Number<T> copy()
allocated
by the calling thread (possibly on the stack).
copy in interface ValueTypepublic final java.lang.String toString()
java.lang.String.
toString in class java.lang.ObjecttoText().toString()
|
JScience v4.3 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||