toxgene.util.cdata.xmark
Class LastNames

java.lang.Object
  extended bytoxgene.util.cdata.xmark.LastNames
All Implemented Interfaces:
ToXgeneCdataGenerator

public class LastNames
extends java.lang.Object
implements ToXgeneCdataGenerator

This class implements a simple CDATA generator that produces random last names according to the rules. specified by the XMark benchmark.

This code is provided as part of ToXgene - (c) 2001 University of Toronto and IBM Corporation.

Version:
1.0
Author:
Denilson Barbosa

Field Summary
static java.lang.String[] data
           
static int len
           
static boolean loaded
           
 
Constructor Summary
LastNames()
          Constructor.
 
Method Summary
 java.lang.String getCdata(int length)
          Generates random text whose length is determined by the parameter length.
static void init()
          This method does all the work of loading the words into memory.
 void setRandomSeed(int seed)
          Specifies a seed for the random generator so that repeated executions always produce the same content, if the same seed is provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

len

public static int len

data

public static java.lang.String[] data

loaded

public static boolean loaded
Constructor Detail

LastNames

public LastNames()
Constructor. There are too many constants to be loaded here, so we cannot declare them explicitly as data = {...}, so we load the words stored in a file within the toxgene.jar package.

Method Detail

setRandomSeed

public void setRandomSeed(int seed)
Specifies a seed for the random generator so that repeated executions always produce the same content, if the same seed is provided.

Specified by:
setRandomSeed in interface ToXgeneCdataGenerator
Parameters:
seed - random seed to initialize the random generator

getCdata

public java.lang.String getCdata(int length)
Generates random text whose length is determined by the parameter length. A value of -1 determines that a string of any length can be returned; a positive value means that a string must be truncated if necessary.

Specified by:
getCdata in interface ToXgeneCdataGenerator
Parameters:
length - specifies the length of the CDATA value to be returned.

init

public static void init()
This method does all the work of loading the words into memory.