org.databene.benerator.primitive
Class UniqueStringGenerator

java.lang.Object
  extended by org.databene.benerator.util.AbstractGenerator<P>
      extended by org.databene.benerator.wrapper.MultiGeneratorWrapper<java.lang.String,java.lang.String>
          extended by org.databene.benerator.primitive.UniqueStringGenerator
All Implemented Interfaces:
java.io.Closeable, Generator<java.lang.String>, org.databene.commons.Resettable, org.databene.commons.ThreadAware

public class UniqueStringGenerator
extends MultiGeneratorWrapper<java.lang.String,java.lang.String>

Generates unique strings of variable length.

Created: 16.11.2007 11:56:15

Author:
Volker Bergmann

Field Summary
 
Fields inherited from class org.databene.benerator.wrapper.MultiGeneratorWrapper
availableSources, sources
 
Fields inherited from class org.databene.benerator.util.AbstractGenerator
context, state
 
Constructor Summary
UniqueStringGenerator()
           
UniqueStringGenerator(int minLength, int maxLength, char... charSet)
           
UniqueStringGenerator(int minLength, int maxLength, java.util.Set<java.lang.Character> charSet)
           
 
Method Summary
 java.lang.String generate()
          Returns an instance of the generic type E.
 java.lang.Class<java.lang.String> getGeneratedType()
          Declares the type of the objects returned by the generate() method.
 int getMaxLength()
           
 int getMinLength()
           
 void init(GeneratorContext context)
           
 void setMaxLength(int maxLength)
           
 void setMinLength(int minLength)
           
 java.lang.String toString()
           
 
Methods inherited from class org.databene.benerator.wrapper.MultiGeneratorWrapper
addSource, close, generateFromAllSources, generateFromRandomSource, getSource, getSources, isParallelizable, isThreadSafe, reset, setSources
 
Methods inherited from class org.databene.benerator.util.AbstractGenerator
assertInitialized, assertNotInitialized, wasInitialized
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UniqueStringGenerator

public UniqueStringGenerator()

UniqueStringGenerator

public UniqueStringGenerator(int minLength,
                             int maxLength,
                             java.util.Set<java.lang.Character> charSet)

UniqueStringGenerator

public UniqueStringGenerator(int minLength,
                             int maxLength,
                             char... charSet)
Method Detail

getMinLength

public int getMinLength()

setMinLength

public void setMinLength(int minLength)

getMaxLength

public int getMaxLength()

setMaxLength

public void setMaxLength(int maxLength)

getGeneratedType

public java.lang.Class<java.lang.String> getGeneratedType()
Description copied from interface: Generator
Declares the type of the objects returned by the generate() method.


init

public void init(GeneratorContext context)
Specified by:
init in interface Generator<java.lang.String>
Overrides:
init in class MultiGeneratorWrapper<java.lang.String,java.lang.String>

generate

public java.lang.String generate()
Description copied from interface: Generator
Returns an instance of the generic type E.


toString

public java.lang.String toString()
Overrides:
toString in class MultiGeneratorWrapper<java.lang.String,java.lang.String>


Copyright © 2011. All Rights Reserved.