|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.seaf.util.Generator
public class Generator
Utility class for random values generation.
| Field Summary | |
|---|---|
static double[] |
LETTER_FREQS
Frequencies of letters in English language. |
| Constructor Summary | |
|---|---|
Generator()
Default constructor. |
|
| Method Summary | |
|---|---|
Calendar |
date()
Generate random date with the given year. |
Calendar |
date(int year)
Generate random date with the given year. |
Calendar |
date(int year,
int month)
Generate random date with the given year and month. |
int |
englishLetterCode()
Generate random letter 0-based index using the letter frequencies of English. |
long |
number(int length)
Generate random number with the specified length. |
long |
number(int min,
int max)
Generate random number with length in the specified interval, inclusive. |
int |
numberExcl(int min,
int max)
Generate random number with value between minimum and maximum (exclusive). |
int |
numberIncl(int min,
int max)
Generate random number with value between minimum and maximum (inclusive). |
String |
phone()
Generate random phone number. |
String |
sentence(int min,
int max)
Generate random sentence of the specified length in characters. |
Calendar |
time()
Generate random time. |
String |
word(int length)
Generate random word with the specified length. |
String |
word(int min,
int max)
Generate random word with length in the specified interval, inclusive. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double[] LETTER_FREQS
| Constructor Detail |
|---|
public Generator()
| Method Detail |
|---|
public int numberExcl(int min,
int max)
min - minimum value, inclusivemax - maximum value, exclusive
public int numberIncl(int min,
int max)
min - minimum value, inclusivemax - maximum value, inclusive
public long number(int length)
length - length of number to be generated in digits
public long number(int min,
int max)
min - minimum length in digits, inclusivemax - maximum length in digits, inclusive
public String phone()
public Calendar date(int year,
int month)
year - full yearmonth - month from 0 to 11
public Calendar date(int year)
year - full year
public Calendar date()
public Calendar time()
public int englishLetterCode()
public String word(int length)
length - length of word to be generated in characters
public String word(int min,
int max)
min - minimum length in characters, inclusivemax - maximum length in characters, inclusive
public String sentence(int min,
int max)
min - minimum length in charactersmax - maximum length in characters
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||