Class BasicStringIncrementer

  extended by edu.byu.ece.edif.core.BasicStringIncrementer

public class BasicStringIncrementer
extends java.lang.Object

Provides methods for "incrementing" a String value. Incrementing is a convenient way of creating unique String names in a deterministic manner.

Constructor Summary
Method Summary
static char incrementDigit(char c)
          This method will perform an "increment" on a character.
static java.lang.String incrementString(java.lang.String str)
          Provide a new String
static java.lang.String incrementString(java.lang.String str, int origLength)
          Increment a string by appending a "_" + num to the end of it.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public BasicStringIncrementer()
Method Detail


public static char incrementDigit(char c)
This method will perform an "increment" on a character. This method will sequence from 'a' to 'z' and then from '0' to '9'. After reaching '9', this method will return back to 'a'. This method will return 0 if the character is invalid.

This method is case insensitive and will return a lower case incremented character.

c - The character to increment.
The incremented character


public static java.lang.String incrementString(java.lang.String str)
Provide a new String

An incremented version of the passed in String object


public static java.lang.String incrementString(java.lang.String str,
                                               int origLength)
Increment a string by appending a "_" + num to the end of it. If there is already an "_" at the end, the number is simply incremented. The original length of the string should be passed in so that the method will be able to determine if the "_" has already been added by this method or not.

str - the String to increment
origLength - the original length of the string to increment
an incremented version of the string