|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.lang.Number
|
+--com.rubecula.jquantity.BaseNumber
|
+--com.rubecula.jquantity.MutableNumber
Abstract class from which to derive other concrete classes of mutable numbers.
Objects of this class can be given identifiers, are changeable under standard arithmetic operators, and can be cloned and presented.
| Field Summary | |
static BaseNumber |
$__1
The constant value: -1 |
static BaseNumber |
$0
The constant value: 0 |
static BaseNumber |
$1
The constant value: 1 |
static BaseNumber |
$10
The constant value: 10 |
static BaseNumber |
$2
The constant value: 2 |
static BaseNumber |
$3
The constant value: 3 |
| Fields inherited from interface com.rubecula.jquantity.Fuzzy |
$DistGaussian, $DistInvalid, $DistNone, $DistUniform, $Names |
| Constructor Summary | |
MutableNumber()
|
|
| Method Summary | |
java.lang.Object |
clone()
Creates and returns a copy of this object. |
protected abstract void |
factor(Integral divisor)
MUTATING METHOD: Replaces value with (this / divisor). |
protected BaseNumber |
factored(Integral factor)
Method to divide this exactly by factor and return the quotient as the result. |
void |
forcePositive()
MUTATING Instance method to force the value to be positive, i.e. |
java.lang.String |
getIdentifier()
Method to get the specific identifier for an object. |
boolean |
isLong()
Method to determine if a value is integral and within range of long. |
protected BaseNumber |
product(BaseNumber multiplicand)
Method to multiply multiplicand to this and return their product as the result. |
void |
setIdentifier(java.lang.String identifier)
Method to set a specific identifier to an object. |
protected void |
setIdentifierPost(java.lang.String suffix)
Method to form a new identifier for an object by appending string and wrapping. |
protected void |
setIdentifierPre(java.lang.String prefix)
Method to form a new identifier for an object by prepending string and wrapping. |
protected BaseNumber |
sum(BaseNumber addend)
Method to add addend to this and return their sum as the result. |
protected void |
test(java.io.PrintStream out,
long check,
java.lang.String label)
Convenience method for auditing/checking a BaseNumber. |
Integral |
toIntegral()
Method to present a MutableNumber as an Integral number. |
| Methods inherited from class com.rubecula.jquantity.BaseNumber |
abs, audit, audit, bestModel, BestModel, Characteristic, compareTo, difference, getBound, getBoundAbs, getModel, impartFuzziness, isEqual, isExact, isUncertain, isZero, minus, pow, present, scaled, test, test, toString, valueOfLog10, Wrap |
| Methods inherited from class java.lang.Number |
byteValue, doubleValue, floatValue, intValue, longValue, shortValue |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.rubecula.jquantity.Arithmutable |
add, multiply, negate, raiseToPower, scale |
| Methods inherited from interface com.rubecula.util.Presentable |
makePresentableInstance, present |
| Methods inherited from interface com.rubecula.jquantity.Arithmetical |
isInfinite, isInteger, isUnity, signum |
| Methods inherited from interface com.rubecula.util.Auditable |
audit |
| Field Detail |
public static final BaseNumber $0
public static final BaseNumber $1
public static final BaseNumber $2
public static final BaseNumber $3
public static final BaseNumber $10
public static final BaseNumber $__1
| Constructor Detail |
public MutableNumber()
| Method Detail |
public java.lang.Object clone()
clone in class java.lang.Objectjava.lang.Exception - : not Cloneable (should be impossible)Cloneable
protected BaseNumber sum(BaseNumber addend)
throws InvalidOperandException
#sumNoRecurse(BaseNumber),
which in turn utilizes Arithmutable.add(BaseNumber).
sum in class BaseNumberaddend - the number to add to this.
InvalidOperandException - operands are not compatible for the
sum operation.
protected BaseNumber product(BaseNumber multiplicand)
throws InvalidOperandException
#productNoRecurse(BaseNumber),
which in turn utilizes Arithmutable.multiply(BaseNumber).
product in class BaseNumbermultiplicand - the number to add to this.
InvalidOperandException - operands are not compatible for the
product operation.public boolean isLong()
public void forcePositive()
forcePositive in interface Arithmutablepublic Integral toIntegral()
public void setIdentifier(java.lang.String identifier)
setIdentifier in interface Identifiableidentifier - the identifier to associate with the objectpublic java.lang.String getIdentifier()
getIdentifier in interface Auditableprotected abstract void factor(Integral divisor)
divisor - value by which this WholeNumber is to be divided.protected BaseNumber factored(Integral factor)
factor - the number to divide into this.
factor(Integral).protected void setIdentifierPost(java.lang.String suffix)
suffix - the identifier to append to object identifierprotected void setIdentifierPre(java.lang.String prefix)
prefix - the identifier to prepend to object identifier
protected void test(java.io.PrintStream out,
long check,
java.lang.String label)
out - the output stream.check - the number to compare against.label - the label to print with the audit trals.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||