goldman.collection
Class BitDigitizer

java.lang.Object
  extended by goldman.collection.BitDigitizer
All Implemented Interfaces:
Digitizer<String>

public class BitDigitizer
extends Object
implements Digitizer<String>

The BitDigitizer class implements the Digitizer interface for a bit string.


Constructor Summary
BitDigitizer()
           
 
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

BitDigitizer

public BitDigitizer()
Method Detail

getBase

public int getBase()
Description copied from interface: Digitizer
Returns the base. Observe that a base b digit takes on values from 0 to b-1.

Specified by:
getBase in interface Digitizer<String>

isPrefixFree

public boolean isPrefixFree()
Description copied from interface: Digitizer
Returns true if and only if the digitizer guarantees that no element is a prefix of another.

Specified by:
isPrefixFree in interface Digitizer<String>

numDigits

public int numDigits(String x)
Description copied from interface: Digitizer
Returns the number of digits in the element x.

Specified by:
numDigits in interface Digitizer<String>

getDigit

public int getDigit(String x,
                    int place)
Description copied from interface: Digitizer
Returns the value of digit place for element x.

Specified by:
getDigit in interface Digitizer<String>

formatDigit

public String formatDigit(String x,
                          int place)
Specified by:
formatDigit in interface Digitizer<String>