Java Utililty Methods ID Value Create

List of utility methods to do ID Value Create

Description

The list of methods to do ID Value Create are organized into topic(s).

Method

StringtoIdentityVariableName(String varName)
translate a string to a valid identity variable name
char[] chars = varName.toCharArray();
long changes = 0;
StringBuilder rtn = new StringBuilder(chars.length + 2);
rtn.append("CF");
for (int i = 0; i < chars.length; i++) {
    char c = chars[i];
    if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9'))
        rtn.append(c);
...
int[]toIdSet(boolean includeAlphaCharacters, String nonAlphaCharacters)
Encodes a set of ASCII characters (< 127) as a bitset of 4 32-bit values.
int[] bits = new int[4]; 
if (includeAlphaCharacters) {
    for (int ch = 'A'; ch <= 'Z'; ch++) {
        bits[ch >>> 5] |= (1 << (ch & 31));
    for (int ch = 'a'; ch <= 'z'; ch++) {
        bits[ch >>> 5] |= (1 << (ch & 31));
for (int i = 0; i < nonAlphaCharacters.length(); i++) {
    int ch = nonAlphaCharacters.charAt(i);
    if (ch >= 128) {
        throw new AssertionError(); 
    bits[ch >>> 5] |= (1 << (ch & 31));
return bits;
StringtoIDString(final byte[] id)
to ID String
final StringBuilder builder = new StringBuilder();
for (final byte each : id) {
    builder.append(each);
return builder.toString();