public class MixedRadixNumber
extends java.lang.Number
| Constructor and Description |
|---|
MixedRadixNumber(int[] radixValues,
int[] radices)
Constructs a mixed radix number with a specified array of numerals and a
specified array of radices.
|
MixedRadixNumber(long value,
int[] radices)
Constructs a mixed radix number with a specified value and a specified
array of radices.
|
MixedRadixNumber(long value,
java.util.List<java.lang.Integer> radices)
Constructs a mixed radix number with a specified value and a specified
list of radices.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
decrement()
Decrements the value of the mixed radix number, if the value is greater
than zero.
|
double |
doubleValue() |
float |
floatValue() |
int |
getCurrentNumeralValue(int atPosition)
Returns the numeral at the specified position.
|
long |
getCurrentValueFor(int[] radixValues)
Returns the value of the mixed radix number with the specified array of
numerals and the current array of radices.
|
long |
getMaxAllowedValue()
Returns the maximum value which can be represented by the current array
of radices.
|
boolean |
increment()
Increments the value of the mixed radix number, if the value is less than
the maximum value which can be represented by the current array of
radices.
|
int |
intValue() |
long |
longValue() |
void |
setCurrentValueFor(int[] radixValues)
Sets the value of the mixed radix number with the specified array of
numerals and the current array of radices.
|
java.lang.String |
toString() |
public MixedRadixNumber(long value,
int[] radices)
value - the value of the mixed radix numberradices - the radices used to represent the value of the mixed radix
numberpublic MixedRadixNumber(long value,
java.util.List<java.lang.Integer> radices)
value - the value of the mixed radix numberradices - the radices used to represent the value of the mixed radix
numberpublic MixedRadixNumber(int[] radixValues,
int[] radices)
radixValues - the numerals of the mixed radix numberradices - the radices of the mixed radix numberpublic long getCurrentValueFor(int[] radixValues)
java.lang.IllegalArgumentException - if any of the specified numerals is less than zero, or if any
of the specified numerals is greater than it's corresponding
radix.public void setCurrentValueFor(int[] radixValues)
radixValues - the numerals of the mixed radix numberpublic long getMaxAllowedValue()
public boolean increment()
true if the increment was successful.public boolean decrement()
true if the decrement was successful.public int getCurrentNumeralValue(int atPosition)
atPosition - the position of the numeral to returnpublic int intValue()
intValue in class java.lang.Numberpublic long longValue()
longValue in class java.lang.Numberpublic float floatValue()
floatValue in class java.lang.Numberpublic double doubleValue()
doubleValue in class java.lang.Numberpublic java.lang.String toString()
toString in class java.lang.Object