|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgoldman.collection.StringDigitizer
public class StringDigitizer
The StringDigitizer class is an implementation of the
Digitizer
interface for a string composed of only the 26 lower
case letters.
REQUIRES:
all strings provided as arguments
contain only the 26 lower case letters
Constructor Summary | |
---|---|
StringDigitizer(int alphabetSize)
|
Method Summary | |
---|---|
String |
formatDigit(String x,
int place)
|
int |
getBase()
Returns the base. |
int |
getDigit(String x,
int place)
Returns the value of digit place
for element x. |
boolean |
isPrefixFree()
Returns true if and only if the digitizer guarantees that no element is a prefix of another. |
int |
numDigits(String x)
Returns the number of digits in the element x. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringDigitizer(int alphabetSize)
Method Detail |
---|
public int getBase()
Digitizer
getBase
in interface Digitizer<String>
public boolean isPrefixFree()
Digitizer
isPrefixFree
in interface Digitizer<String>
public int numDigits(String x)
Digitizer
numDigits
in interface Digitizer<String>
x
- the given string
public int getDigit(String x, int place)
Digitizer
place
for element x.
getDigit
in interface Digitizer<String>
x
- the given stringplace
- the place of the desired digit, where the leftmost digit
is place 0
public String formatDigit(String x, int place)
formatDigit
in interface Digitizer<String>
x
- the given stringplace
- the place for the desired digit
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |