/** RadixString class **/ public class RadixString implements RadixKey { private String s; public RadixString( String sa ) { s = sa; } public int getRadix( int level ) { // If the position is already at the end of the String // use the reserved position if ( level >= s.length() ) return -1; char c = s.charAt( level ); int n = Character.getNumericValue(c); // if ( n > 255 ) { n = n % 256 ); return n; } /** In this case, the object and its key are the same **/ public boolean keyEqual( RadixKey a ) { RadixString sa = (RadixString)a; String buffer = sa.toString(); return s.equals( buffer ); } public String toString() { return s; } public int maxValue( int level ) { return 256; } public int max_length(){ return s.length(); } }