calypso.util
Class Abacus

java.lang.Object
  |
  +--calypso.util.Abacus

public class Abacus
extends java.lang.Object

A class for counting in a variety of bases.


Field Summary
static java.lang.String[] bases
           
protected static java.lang.String gAlphaChars
           
protected static java.lang.String gBinaryChars
           
protected static java.lang.String gHexChars
           
protected static java.lang.String gRomanCharsA
           
protected static java.lang.String gRomanCharsB
           
static java.lang.String[] ones
          Formatting Strings
static java.lang.String[] teens
           
static java.lang.String[] tens
           
 
Constructor Summary
Abacus()
           
 
Method Summary
static java.lang.String getAlphaString(int aValue)
          Formats the value as an alpha string
static java.lang.String getBinaryString(int aValue)
          Convert the given integer value into a string of binary digits
static java.lang.String getHexString(int aValue)
          Convert the given integer value into a hexstring
static java.lang.String getRomanString(int aValue)
          Convert the given integer value into a roman numeral string
static java.lang.String getSeriesString(int aValue, java.lang.String aCharSet, int anOffset, int aBase)
          Convert the given integer value into a series string.
static java.lang.String getSpokenString(int aValue)
          Convert the given integer value into spoken string (one, two, three...)
static void main(java.lang.String[] argv)
           
static void PadPrint(int aValue, int width)
           
static void PadPrint(java.lang.String aString, int aWidth)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ones

public static final java.lang.String[] ones
Formatting Strings

teens

public static final java.lang.String[] teens

tens

public static final java.lang.String[] tens

bases

public static final java.lang.String[] bases

gAlphaChars

protected static final java.lang.String gAlphaChars

gRomanCharsA

protected static final java.lang.String gRomanCharsA

gRomanCharsB

protected static final java.lang.String gRomanCharsB

gHexChars

protected static final java.lang.String gHexChars

gBinaryChars

protected static final java.lang.String gBinaryChars
Constructor Detail

Abacus

public Abacus()
Method Detail

getAlphaString

public static java.lang.String getAlphaString(int aValue)
Formats the value as an alpha string
Returns:
 

getRomanString

public static java.lang.String getRomanString(int aValue)
Convert the given integer value into a roman numeral string
Parameters:
aValue - - int to be converted to roman
Returns:
new string

getHexString

public static java.lang.String getHexString(int aValue)
Convert the given integer value into a hexstring
Parameters:
aValue - - int to be converted to hex string
Returns:
new string

getBinaryString

public static java.lang.String getBinaryString(int aValue)
Convert the given integer value into a string of binary digits
Parameters:
aValue - - int to be converted to binary string
Returns:
new string

getSpokenString

public static java.lang.String getSpokenString(int aValue)
Convert the given integer value into spoken string (one, two, three...)
Parameters:
aValue - - int to be converted to hex string
Returns:
new stringbuffer

getSeriesString

public static java.lang.String getSeriesString(int aValue,
                                               java.lang.String aCharSet,
                                               int anOffset,
                                               int aBase)
Convert the given integer value into a series string. These are any arbitrary but repeating pattern of characters.
Parameters:
aValue - - int to be converted to series string
Returns:
new string

PadPrint

public static void PadPrint(int aValue,
                            int width)

PadPrint

public static void PadPrint(java.lang.String aString,
                            int aWidth)

main

public static void main(java.lang.String[] argv)