codesimian
Class Names

java.lang.Object
  extended by codesimian.Names

public class Names
extends java.lang.Object

generates unique, and often descriptive, String names for a CS or Object. Describes existing global names.


Method Summary
static java.lang.String bitsAndCharsetToString(boolean[] bits, java.lang.String charset, boolean useLastBits)
          For example, if charset.length()==32, then returns a String whose length is bits.length/5.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

bitsAndCharsetToString

public static java.lang.String bitsAndCharsetToString(boolean[] bits,
                                                      java.lang.String charset,
                                                      boolean useLastBits)
For example, if charset.length()==32, then returns a String whose length is bits.length/5.

If bits.length/5 is not a whole number and useLastBits==true, then the last char in the returned String is chosen from some lower part of the charset.

If bits.length/5 is not a whole number and useLastBits==false, then the String is 1 char shorter and every char is chosen from the whole charset, and some of the last bits are wasted.