public class WeightedLetterNamegen
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String[] |
COMMON_USA_FEMALE_NAMES |
static java.lang.String[] |
COMMON_USA_LAST_NAMES |
static java.lang.String[] |
COMMON_USA_MALE_NAMES |
static java.lang.String[] |
LOVECRAFT_MYTHOS_NAMES |
static java.lang.String[] |
STAR_WARS_STYLE_NAMES |
static java.lang.String[] |
VIKING_STYLE_NAMES |
| Constructor and Description |
|---|
WeightedLetterNamegen(java.lang.String[] names)
Creates the generator by seeding the provided list of names.
|
WeightedLetterNamegen(java.lang.String[] names,
int consonantLimit)
Creates the generator by seeding the provided list of names.
|
WeightedLetterNamegen(java.lang.String[] names,
int consonantLimit,
IStatefulRNG rng)
Creates the generator by seeding the provided list of names.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
generate()
Gets one random String name.
|
java.lang.String[] |
generate(int amountToGenerate)
Gets an array of random String names, sized to match amountToGenerate.
|
java.util.ArrayList<java.lang.String> |
generateList(int amountToGenerate)
Gets an ArrayList of random String names, sized to match amountToGenerate.
|
public static final java.lang.String[] VIKING_STYLE_NAMES
public static final java.lang.String[] STAR_WARS_STYLE_NAMES
public static final java.lang.String[] COMMON_USA_MALE_NAMES
public static final java.lang.String[] COMMON_USA_FEMALE_NAMES
public static final java.lang.String[] COMMON_USA_LAST_NAMES
public static final java.lang.String[] LOVECRAFT_MYTHOS_NAMES
public WeightedLetterNamegen(java.lang.String[] names)
names - an array of Strings that are typical names to be emulatedpublic WeightedLetterNamegen(java.lang.String[] names,
int consonantLimit)
names - an array of Strings that are typical names to be emulatedconsonantLimit - the maximum allowed consonants in a rowpublic WeightedLetterNamegen(java.lang.String[] names,
int consonantLimit,
IStatefulRNG rng)
names - an array of Strings that are typical names to be emulatedconsonantLimit - the maximum allowed consonants in a rowrng - the source of randomness to be usedpublic java.lang.String generate()
public java.util.ArrayList<java.lang.String> generateList(int amountToGenerate)
amountToGenerate - how many String items to include in the returned ArrayListpublic java.lang.String[] generate(int amountToGenerate)
amountToGenerate - how many String items to include in the returned arrayCopyright © Eben Howard 2012–2022. All rights reserved.