|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rubecula.util.Item
com.rubecula.jquantity.BaseNumber
com.rubecula.jquantity.Manifest
This class defines a "manifest" constant (a whole number which cannot be changed). Its identification is self-evident.
In terms of information content, this object is a wrapper around a long,
but it conforms also to BaseNumber.
It does not have the range of the BigInteger as it is designed solely for
normal known constants.
Note that it would have been preferable to extend Long instead of
reference a long value,
however Long is a final class and thus cannot be extended.
Field Summary | |
private long |
_Value
This is the value of this constant. |
static Manifest |
$__1
Manifest constant -1. |
static Manifest |
$_c
Manifest constant: speed of light in meter/sec |
static Manifest |
$0
Manifest constant 0. |
static Manifest |
$1
Manifest constant 1. |
static Manifest |
$10
Manifest constant 10. |
(package private) static long |
$10L
|
static Manifest |
$12
Manifest constant 12. |
static Manifest |
$2
Manifest constant 2. |
static Manifest |
$3
Manifest constant 3. |
static Manifest |
$4
Manifest constant 4. |
static Manifest |
$6
Manifest constant 6. |
Fields inherited from class com.rubecula.jquantity.BaseNumber |
|
Fields inherited from class com.rubecula.util.Item |
JQUANTITY_TEST |
Fields inherited from interface com.rubecula.jquantity.Fuzzy |
$DistGaussian, $DistInvalid, $DistNone, $DistUniform, $Names |
Constructor Summary | |
Manifest(long value)
Primary constructor to create a Manifest from a long. |
|
Manifest(java.lang.String string)
Constructor to create a Manifest from a decimal String. |
|
Manifest(java.lang.String string,
int radix)
Constructor to create a Manifest from a String defined by radix. |
Method Summary | |
java.lang.String |
audit()
Method to return a detailed (unlabeled) string from an arithmetical object for debugging purposes. |
void |
audit(java.io.PrintStream out,
java.lang.String label)
Method to write the detailed (labeled) account of this object to print stream out. |
java.lang.String |
audit(java.lang.String label)
Method to return a detailed string from an arithmetical object for debugging purposes. |
int |
compareTo(java.lang.Integer o)
Method to fulfill contract defined by Comparable. |
int |
compareTo(java.lang.Long o)
Method to fulfill contract defined by Comparable. |
int |
compareTo(Manifest o)
Method to fulfill contract defined by Comparable. |
BaseNumber |
difference(BaseNumber subtrahend)
Method to yield the difference of this less a BaseNumber (subtrahend). |
double |
doubleValue()
Method to fulfill contract defined by Number. |
protected Manifest |
factored(long factor)
|
float |
floatValue()
Returns the value of the specified number as a float .
|
java.lang.String |
getIdentifier()
Method to fulfill contract defined by Auditable. |
int |
intValue()
Method to fulfill contract defined by Number and Integral. |
boolean |
isInfinite()
Method to fulfill contract defined by Arithmetical. |
boolean |
isInteger()
Method to fulfill contract defined by Arithmetical. |
boolean |
isPowerOfTen()
Method to determine if this is a power of ten and ten only. |
boolean |
isUnity()
Method to fulfill contract defined by Arithmetical. |
long |
longValue()
Method to fulfill contract defined by Number and Integral. |
Presentable |
makePresentableInstance(Presentation presentation)
Instance method to convert a Presentation into a Presentable. |
BaseNumber |
minus()
Method to fulfill contract defined by BaseNumber. |
BaseNumber |
pow(int power)
Method to raise this to the power power return the result. |
Presentation |
present(AttrMap attributes)
Convert this Presentable object into a Presentation, according to the set of attributes provided. |
BaseNumber |
product(BaseNumber multiplicand)
Method to multiply multiplicand by this and return their product as the result. |
BaseNumber |
scaled(long factor)
Method to multiply multiplicand by this and return their product as the result. |
int |
signum()
Method to fulfill contract defined by Arithmetical and Integral. |
BaseNumber |
sum(BaseNumber addend)
Method to add addend to this and return their sum as the result. |
java.math.BigInteger |
toBigInteger()
Convert this into a BigInteger. |
java.lang.String |
toString()
This is the default toString method for all Items. |
Methods inherited from class com.rubecula.jquantity.BaseNumber |
abs, bestModel, BestModel, byteValue, characteristic, Characteristic, getBound, getBoundAbs, getModel, impartFuzziness, isEqual, isExact, isUncertain, isZero, shortValue, valueOf, valueOf, valueOfLog10 |
Methods inherited from class com.rubecula.util.Item |
compareTo, Debug, getClassNameShort, getType, IsDebug, present, SetDebug, test, test, Wrap |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.rubecula.jquantity.Integral |
isExact, isZero |
Field Detail |
public static final Manifest $0
public static final Manifest $1
public static final Manifest $2
public static final Manifest $3
public static final Manifest $4
public static final Manifest $6
static final long $10L
public static final Manifest $10
public static final Manifest $12
public static final Manifest $__1
public static final Manifest $_c
private final long _Value
Constructor Detail |
public Manifest(long value)
value
- long: the value for the new object.public Manifest(java.lang.String string)
string
- the value for the new object.public Manifest(java.lang.String string, int radix)
string
- the representation of the value in base radixradix
- the radix defining the string representation.Method Detail |
public BaseNumber minus()
minus
in interface Integral
minus
in class BaseNumber
public BaseNumber sum(BaseNumber addend) throws InvalidOperandException
sum
in class BaseNumber
addend
- the number to add to this.
InvalidOperandException
- operands are not compatible for the
sum operation.public BaseNumber difference(BaseNumber subtrahend) throws InvalidOperandException
difference
in class BaseNumber
subtrahend
- the number to subtract from this.
InvalidOperandException
- operands are not compatible for the
difference operation.BaseNumber.sum(BaseNumber)
,
BaseNumber.minus()
public BaseNumber product(BaseNumber multiplicand) throws InvalidOperandException
product
in class BaseNumber
multiplicand
- the number to multiply by this.
InvalidOperandException
public BaseNumber scaled(long factor)
scaled
in class BaseNumber
factor
- the number to multiply by this.
public BaseNumber pow(int power)
pow
in class BaseNumber
power
- the exponent for this.
public int signum()
signum
in interface Arithmetical
public boolean isInteger()
isInteger
in interface Arithmetical
public boolean isInfinite()
isInfinite
in interface Arithmetical
public boolean isUnity()
isUnity
in interface Arithmetical
public int intValue()
intValue
in interface Integral
intValue
in class BaseNumber
java.lang.ArithmeticException
- : may lose precision.public long longValue()
longValue
in interface Integral
longValue
in class BaseNumber
public java.math.BigInteger toBigInteger()
toBigInteger
in interface Integral
public boolean isPowerOfTen()
isPowerOfTen
in interface Integral
public float floatValue()
BaseNumber
float
.
This may involve rounding.
floatValue
in class BaseNumber
java.lang.ArithmeticException
- : may lose precision.public double doubleValue()
doubleValue
in class BaseNumber
public java.lang.String getIdentifier()
getIdentifier
in interface Identifiable
public int compareTo(java.lang.Long o)
o
- the Long with which to compare this,
must be either Long or Integer.
java.lang.UnsupportedOperationException
- if the specified object's type prevents it
from being compared to this Object.public int compareTo(Manifest o)
o
- the Manifest with which to compare this.
java.lang.UnsupportedOperationException
- if the specified object's type prevents it
from being compared to this Object.public int compareTo(java.lang.Integer o)
o
- the Integer with which to compare this.
java.lang.UnsupportedOperationException
- if the specified object's type prevents it
from being compared to this Object.public Presentation present(AttrMap attributes) throws PresentationException
present
in interface Presentable
attributes
- a map of the attributes desired for this presentation.
PresentationException
public Presentable makePresentableInstance(Presentation presentation)
makePresentableInstance
in interface Presentable
presentation
- a presentation of a number which you want to convert into a number.
public java.lang.String audit(java.lang.String label)
audit
in interface Auditable
label
- String: the label to associate with the data.
public java.lang.String audit()
audit
in interface Auditable
audit
in class Item
Auditable.audit(String)
public void audit(java.io.PrintStream out, java.lang.String label)
audit
in interface Auditable
audit
in class Item
out
- PrintStream: the output stream.label
- String: the label to be used.Auditable.audit(String)
,
Item.getClassNameShort()
,
PrintStream.println(String)
public java.lang.String toString()
Item
toString
in class Item
Item.present()
,
Presentation.toString()
protected Manifest factored(long factor)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |