com.rubecula.jquantity
Interface Integral

All Superinterfaces:
Arithmetical, Auditable, Identifiable
All Known Implementing Classes:
Manifest, WholeNumber

public interface Integral
extends Arithmetical, Auditable

Interface to define Integral operations.

Since:
V_0_1
Version:
$Revision: 1.4 $
Author:
Robin Hillyard

Method Summary
 int intValue()
          Returns the value of the specified number as an int.
 boolean isExact()
          Method to determine if the quantity represented is in fact exact.
 boolean isPowerOfTen()
          Method to determine if this is a power of ten and ten only.
 boolean isZero()
          Method to determine if the quantity represented is in fact the integer value zero.
 long longValue()
          Returns the value of the specified number as a long.
 BaseNumber minus()
          Method to yield a copy of this but with the sign changed.
 java.math.BigInteger toBigInteger()
          Convert this into a BigInteger.
 
Methods inherited from interface com.rubecula.jquantity.Arithmetical
isInfinite, isInteger, isUnity, signum
 
Methods inherited from interface com.rubecula.util.Auditable
audit, audit, audit
 
Methods inherited from interface com.rubecula.util.Identifiable
getIdentifier
 

Method Detail

intValue

public int intValue()
Returns the value of the specified number as an int.

Returns:
the value of this as an int.

longValue

public long longValue()
Returns the value of the specified number as a long.

Returns:
the value of this as a long.

minus

public BaseNumber minus()

Method to yield a copy of this but with the sign changed.
NOTE: it is a requirement of this method that the class of the result is the same as the class of this so that the result can be safely cast to the original class.

Note that this method is parallel but not congruent with the method of the same name defined in the BaseNumber abstract class.

Returns:
negative version of this.

isPowerOfTen

public boolean isPowerOfTen()
Method to determine if this is a power of ten and ten only.

Returns:
true if this can be successively divided exactly by ten until 1 is the only remaining factor.

toBigInteger

public java.math.BigInteger toBigInteger()
Convert this into a BigInteger.

Returns:
the BigInteger equivalent of this.

isExact

public boolean isExact()
Method to determine if the quantity represented is in fact exact.

Returns:
true if exact.

isZero

public boolean isZero()
Method to determine if the quantity represented is in fact the integer value zero.

Returns:
true if zero.