com.rubecula.jquantity
Class DivisibleMutable

java.lang.Object
  |
  +--com.rubecula.jquantity.DivisibleMutable
All Implemented Interfaces:
java.lang.Cloneable, Divisible, Mutable

public abstract class DivisibleMutable
extends java.lang.Object
implements Divisible, Mutable

Interface to define Mutating Divisible arithmetical operations. Essentially these are operations which can transform an integer (or any number) into a non-integer.

Version:
$Revision: 1.1 $
Author:
Robin Hillyard

Constructor Summary
DivisibleMutable()
           
 
Method Summary
abstract  void divide(BaseNumber divisor)
          MUTATING method to replace this with quotient of this over divisor.
abstract  void invert()
          MUTATING Instance method to invert this object arithmetically (i.e.
abstract  void scale(double factor)
          MUTATING Instance method to multiply this by a scale factor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.rubecula.jquantity.Divisible
inverse, quotient, scaled
 

Constructor Detail

DivisibleMutable

public DivisibleMutable()
Method Detail

scale

public abstract void scale(double factor)
MUTATING Instance method to multiply this by a scale factor. Note that under this operation, the scaling (multiplication) is always directly on the value in this regardless of type. So for example, if this is an instance of Value of type Log, then the effect of a scale by rwo will be to square the effective value.

Parameters:
factor - the scale factor.

invert

public abstract void invert()
MUTATING Instance method to invert this object arithmetically (i.e. replace this by its reciprocal).


divide

public abstract void divide(BaseNumber divisor)
MUTATING method to replace this with quotient of this over divisor.

Parameters:
divisor - the value to be divided into this.