|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.siefkes.nlstego.NLStego
public class NLStego
The main entry point of this program.
| Field Summary | |
|---|---|
static String |
ID
The ID of this software, used as base name of the config file etc.: "nlstego". |
static char |
INVALID_COMMAND
Marker used for invalid or missing commands. |
static Log |
LOG
The logger used in this system. |
static String |
NAME
The name of this software: "NLStego". |
static ResourceBundle |
RES
Messages used by this program. |
static String |
VERSION_NO
The current version number of this software: "0.9-dev". |
| Constructor Summary | |
|---|---|
NLStego(Configuration myConfig)
Creates a new instance, using the standard input/output/error streams for I/O. |
|
NLStego(Configuration myConfig,
InputStream myInStream,
PrintStream myOutStream,
PrintStream myErrStream)
Creates a new instance. |
|
| Method Summary | |
|---|---|
TextModel |
buildTextModel(String[] filePaths,
boolean recurse)
Build a text model from a set of texts. |
void |
execute(char command,
List<String> arguments)
Executes the given command on the given arguments (if any). |
String |
generateText(TextModel textModel,
int numWords)
Generates random text. |
static void |
main(String[] args)
Static main method: create and configure a new instance and executes the given command (first argument) on the given arguments. |
void |
printUsage()
Helper method that prints usage instructions to the error stream. |
void |
printVersion()
Helper method that prints name and version number of this program to the error stream. |
void |
printWrapped(String text)
Helper method that prints a text to the output stream, adding linebreaks after 75 characters. |
void |
printWrapped(String text,
int n)
Helper method that prints a text to the output stream, adding linebreaks after the specified number of characters. |
String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String ID
public static final String NAME
public static final String VERSION_NO
public static final char INVALID_COMMAND
public static final Log LOG
public static final ResourceBundle RES
| Constructor Detail |
|---|
public NLStego(Configuration myConfig)
myConfig - used to configure this instance
public NLStego(Configuration myConfig,
InputStream myInStream,
PrintStream myOutStream,
PrintStream myErrStream)
myConfig - used to configure this instancemyInStream - stream used to read inputmyOutStream - stream used to write outputmyErrStream - stream used to write error and warn message| Method Detail |
|---|
public static void main(String[] args)
args - the command-line parameters: first element must be the
command to execute (e to encode, d to decode,
or g to generate random text); elements starting with "-"
are processed as configuration options (cf.
Util.configureFromArgs(Configuration, String[]))
public TextModel buildTextModel(String[] filePaths,
boolean recurse)
throws IOException
filePaths - array of paths of the text to use for building the
model; resolved via the
Commons VFSrecurse - whether to recursively add the children of folders and
other files containing nested entries
IOException - if an error occurs while reading training texts
public void execute(char command,
List<String> arguments)
throws IOException
command - the command to executearguments - a list of any further arguments for this command
IOException - if an I/O error occurs
public String generateText(TextModel textModel,
int numWords)
throws IOException
textModel - the text model to usenumWords - the minimum number of words to generate
IOException - if an I/O error occurspublic void printWrapped(String text)
text - the text to print
public void printWrapped(String text,
int n)
n - the maximum number of characters in a linetext - the text to printpublic void printUsage()
public void printVersion()
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||