org.jwalk.gen
Class StringGenerator

java.lang.Object
  extended by org.jwalk.gen.StringGenerator
All Implemented Interfaces:
CustomGenerator, Generator

public class StringGenerator
extends java.lang.Object
implements CustomGenerator

StringGenerator is a custom generator to synthesise string values. Rather than produce empty strings, this custom StringGenerator produces conventional strings, starting with each letter of the alphabet.

Version:
1.0
Author:
Anthony Simons

Constructor Summary
StringGenerator()
          Constructs a StringGenerator.
 
Method Summary
 boolean canCreate(java.lang.Class<?> type)
          Reports whether this StringGenerator can create a given type.
 java.lang.Object nextValue(java.lang.Class<?> type)
          Returns the next String value in sequence.
 void setOwner(MasterGenerator generator)
          Sets the owning MasterGenerator for this CustomGenerator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringGenerator

public StringGenerator()
Constructs a StringGenerator. Initially, the seed index into the array of standard strings is zero.

Method Detail

canCreate

public boolean canCreate(java.lang.Class<?> type)
Reports whether this StringGenerator can create a given type.

Specified by:
canCreate in interface Generator
Parameters:
type - the requested type.
Returns:
true if the type is: String.

nextValue

public java.lang.Object nextValue(java.lang.Class<?> type)
Returns the next String value in sequence. Always returns another String, ignoring the type argument.

Specified by:
nextValue in interface Generator
Parameters:
type - the requested type.
Returns:
a conventional String object.

setOwner

public void setOwner(MasterGenerator generator)
Sets the owning MasterGenerator for this CustomGenerator. This is a nullop in StringGenerator.

Specified by:
setOwner in interface CustomGenerator