|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgoldman.collection.IndexedNumber
public class IndexedNumber
The IndexedNumber class illustrates a way to provide access to the digits of a number.
Nested Class Summary | |
---|---|
static class |
IndexedNumber.NumberDigitizer
This class provides a sample implementation for the Digitizer
interface for base 10 numbers that uses standard place value to report the value
for each digit. |
Constructor Summary | |
---|---|
IndexedNumber(BigInteger value)
Initializes the value of this indexed number to the provided BigInteger. |
|
IndexedNumber(int value)
Initializes the value of this indexed number to the provided integer. |
|
IndexedNumber(long value)
Initializes the value of this indexed number to the provided long. |
Method Summary | |
---|---|
int |
getDigit(int place)
Returns the integer representation for the digit at the given place . |
boolean |
isPrefixFree()
|
int |
numDigits()
|
String |
printDigit(int place)
Returns the string representation for the digit in the given place. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IndexedNumber(int value)
public IndexedNumber(long value)
public IndexedNumber(BigInteger value)
Method Detail |
---|
public int numDigits()
public boolean isPrefixFree()
public String toString()
toString
in class Object
public int getDigit(int place)
place
. This method treats each element
as if it was padded infinitely to the left with zeros. For example,
562 can be viewed as ...000562.
public String printDigit(int place)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |