public abstract class CompositeNumber extends RealNumber
MAXIMUM_RADIX
ROUND_CEILING, ROUND_DOWN, ROUND_FLOOR, ROUND_UP
Modifier | Constructor and Description |
---|---|
protected |
CompositeNumber(int sign,
java.lang.String asString)
Constructs a new
CompositeNumber object. |
Modifier and Type | Method and Description |
---|---|
abstract RealNumber |
getElement(int n)
Returns the nth operand.
|
abstract int |
getElementCount()
Counts the number of operands.
|
abstract RealNumber[] |
getElements()
Returns the operands.
|
abs, add, byteValue, compareTo, compareTo, compareToImpl, divide, doubleValue, equals, fitsByte, fitsDouble, fitsFloat, fitsInt, fitsLong, fitsShort, floatValue, getSign, intValue, invert, longValue, multiply, negate, pow, powImpl, round, shortValue, subtract, toBigDecimal, toBigDecimal, toBigInteger, toString, trunc
protected CompositeNumber(int sign, java.lang.String asString) throws java.lang.IllegalArgumentException
CompositeNumber
object.
The sign of the value needs to be specified. Any negative value is
interpreted as meaning that the value of this number is negative. Any
positive value is interpreted as meaning that the value of this number
is positive.sign
- the sign of this number, either a positive number if the number is
greater than zero, 0 if the number equals zero or a negative number
if the number is smaller than zero.asString
- a textual presentation of this number, not null
.java.lang.IllegalArgumentException
- if asString == null
.public abstract RealNumber[] getElements()
public abstract int getElementCount()
public abstract RealNumber getElement(int n) throws java.lang.IndexOutOfBoundsException
n
- the index of the operand, >= 0 and <
getElementCount()
.null
.java.lang.IndexOutOfBoundsException
- if one of the following applies:
n < 0
n >= operandCount