public class DictionaryNameFactory extends java.lang.Object implements NameFactory
NameFactory generates names that are read from a
specified input file.
Comments (everything starting with '#' on a single line) are ignored.| Constructor and Description |
|---|
DictionaryNameFactory(DictionaryNameFactory dictionaryNameFactory,
NameFactory nameFactory)
Creates a new
DictionaryNameFactory. |
DictionaryNameFactory(java.io.File file,
boolean validJavaIdentifiers,
NameFactory nameFactory)
Creates a new
DictionaryNameFactory. |
DictionaryNameFactory(java.io.File file,
NameFactory nameFactory)
Creates a new
DictionaryNameFactory. |
DictionaryNameFactory(java.io.Reader reader,
boolean validJavaIdentifiers,
NameFactory nameFactory)
Creates a new
DictionaryNameFactory. |
DictionaryNameFactory(java.io.Reader reader,
NameFactory nameFactory)
Creates a new
DictionaryNameFactory. |
DictionaryNameFactory(java.net.URL url,
boolean validJavaIdentifiers,
NameFactory nameFactory)
Creates a new
DictionaryNameFactory. |
DictionaryNameFactory(java.net.URL url,
NameFactory nameFactory)
Creates a new
DictionaryNameFactory. |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args) |
java.lang.String |
nextName() |
void |
reset() |
public DictionaryNameFactory(java.net.URL url,
NameFactory nameFactory)
throws java.io.IOException
DictionaryNameFactory.url - the URL from which the names can be read.nameFactory - the name factory from which names will be retrieved
if the list of read names has been exhausted.java.io.IOExceptionpublic DictionaryNameFactory(java.net.URL url,
boolean validJavaIdentifiers,
NameFactory nameFactory)
throws java.io.IOException
DictionaryNameFactory.url - the URL from which the names can be read.validJavaIdentifiers - specifies whether the produced names should
be valid Java identifiers.nameFactory - the name factory from which names will be
retrieved if the list of read names has been
exhausted.java.io.IOExceptionpublic DictionaryNameFactory(java.io.File file,
NameFactory nameFactory)
throws java.io.IOException
DictionaryNameFactory.file - the file from which the names can be read.nameFactory - the name factory from which names will be retrieved
if the list of read names has been exhausted.java.io.IOExceptionpublic DictionaryNameFactory(java.io.File file,
boolean validJavaIdentifiers,
NameFactory nameFactory)
throws java.io.IOException
DictionaryNameFactory.file - the file from which the names can be read.validJavaIdentifiers - specifies whether the produced names should
be valid Java identifiers.nameFactory - the name factory from which names will be
retrieved if the list of read names has been
exhausted.java.io.IOExceptionpublic DictionaryNameFactory(java.io.Reader reader,
NameFactory nameFactory)
throws java.io.IOException
DictionaryNameFactory.reader - the reader from which the names can be read. The
reader is closed at the end.nameFactory - the name factory from which names will be retrieved
if the list of read names has been exhausted.java.io.IOExceptionpublic DictionaryNameFactory(java.io.Reader reader,
boolean validJavaIdentifiers,
NameFactory nameFactory)
throws java.io.IOException
DictionaryNameFactory.reader - the reader from which the names can be read.
The reader is closed at the end.validJavaIdentifiers - specifies whether the produced names should
be valid Java identifiers.nameFactory - the name factory from which names will be
retrieved if the list of read names has been
exhausted.java.io.IOExceptionpublic DictionaryNameFactory(DictionaryNameFactory dictionaryNameFactory, NameFactory nameFactory)
DictionaryNameFactory.dictionaryNameFactory - the dictionary name factory whose dictionary
will be used.nameFactory - the name factory from which names will be
retrieved if the list of read names has been
exhausted.public void reset()
reset in interface NameFactorypublic java.lang.String nextName()
nextName in interface NameFactorypublic static void main(java.lang.String[] args)