org.marketcetera.ors.info
Class NameGenerator

java.lang.Object
  extended by org.marketcetera.ors.info.NameGenerator

public class NameGenerator
extends Object

A generator of unique names comprising a prefix, a separator, and a monotonically increasing integer. Uniqueness is guaranteed only in the context of the current process and provided no more than Integer.MAX_VALUE names are generated.

Since:
2.0.0
Version:
$Id: NameGenerator.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Field Summary
static String INT_SEPARATOR
          The separator between the prefix and the integer.
 
Constructor Summary
NameGenerator(String prefix)
          Creates a new name generator that uses the given prefix.
 
Method Summary
 String getNextName()
          Returns the receiver's next generated name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INT_SEPARATOR

public static final String INT_SEPARATOR
The separator between the prefix and the integer.

See Also:
Constant Field Values
Constructor Detail

NameGenerator

public NameGenerator(String prefix)
Creates a new name generator that uses the given prefix.

Parameters:
prefix - The prefix.
Method Detail

getNextName

public String getNextName()
Returns the receiver's next generated name.

Returns:
The name.


Copyright © 2012. All Rights Reserved.