|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectmeshi.util.MeshiProgram
public class MeshiProgram
The (suggested) superclass of programs using the meshi package. It includes a bunch of usefull static methods and global variables.
| Nested Class Summary | |
|---|---|
private static class |
MeshiProgram.GlobalElement
An element of the keyword-value table. |
private static class |
MeshiProgram.GlobalElementList
A keyword-value table |
| Field Summary | |
|---|---|
protected static java.lang.String |
commandLine
The command line with which the program was called. |
private static MeshiProgram.GlobalElementList |
globalTable
After program initiation, stores all the information needed for program execution. |
protected static java.lang.String |
name
Program name. |
private static java.util.Random |
randomNumberGenerator
The single random number generator used by the program. |
private static int |
seed
The seed of the random number generator. |
| Constructor Summary | |
|---|---|
MeshiProgram()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
about()
What you always wanted to know. |
static boolean |
debug()
Gets the boolean value associated with the keyword debug. |
protected static java.lang.String |
get2ndString(java.lang.String line,
java.lang.String commandsFileName)
|
static boolean |
getb(java.lang.String key)
Gets the boolean value associated with the keyword key. |
static java.lang.Boolean |
getB(java.lang.String key)
Gets the Boolean value associated with the keyword key. |
private static java.lang.String |
getCommandLine(java.lang.String[] args)
Assembles the command-line string from an array of command-line-words. |
static double |
getd(java.lang.String key)
Gets the double value associated with the keyword key. |
static java.lang.Double |
getD(java.lang.String key)
Gets the Double value associated with the keyword key. |
protected static boolean |
getFlag(java.lang.String key,
java.lang.String[] args)
Get a boolean flag Searcheds for a the keyword key in args. |
protected static java.lang.String |
getFlagedArgument(java.lang.String key,
java.lang.String[] args)
Searcheds for a the keyword key in args. |
static int |
geti(java.lang.String key)
Gets the int value associated with the keyword key. |
static java.lang.Integer |
getI(java.lang.String key)
Gets the Integer value associated with the keyword key. |
protected static java.lang.String |
getOrderedArgument(java.lang.String[] args)
Removes the first string in args and returns it. |
static java.lang.String |
getS(java.lang.String key)
Gets the String value associated with the keyword key. |
static java.lang.String |
getS(java.lang.String key,
StringList commands,
java.lang.String commandsFileName)
|
protected static void |
initRandom()
Initializes the random number generator. |
static void |
initRandom(int seed)
|
protected static int |
initRandom(java.lang.String[] argv)
|
static void |
printGlobalTable()
Print the keyword - value table. |
static java.util.Random |
randomNumberGenerator()
Gets the program's random number generator. |
static int |
seed()
|
protected static java.lang.Object |
tableGet(java.lang.String key)
Gets the value associated with the keyword key. |
static boolean |
tableIncludes(java.lang.String key)
|
protected static java.lang.Object |
tableSet(java.lang.String key,
java.lang.Object value)
Associate a value to a keyword. |
java.lang.String |
toString()
|
static boolean |
verbose()
Gets the boolean value associated with the keyword verbose. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static MeshiProgram.GlobalElementList globalTable
protected static java.lang.String name
protected static java.lang.String commandLine
private static java.util.Random randomNumberGenerator
private static int seed
| Constructor Detail |
|---|
public MeshiProgram()
| Method Detail |
|---|
public static int seed()
protected static boolean getFlag(java.lang.String key,
java.lang.String[] args)
protected static java.lang.String getFlagedArgument(java.lang.String key,
java.lang.String[] args)
protected static java.lang.String getOrderedArgument(java.lang.String[] args)
protected static java.lang.Object tableSet(java.lang.String key,
java.lang.Object value)
public static boolean tableIncludes(java.lang.String key)
protected static java.lang.Object tableGet(java.lang.String key)
public static java.lang.Double getD(java.lang.String key)
public static java.lang.Integer getI(java.lang.String key)
public static java.lang.Boolean getB(java.lang.String key)
public static java.lang.String getS(java.lang.String key)
public static java.lang.String getS(java.lang.String key,
StringList commands,
java.lang.String commandsFileName)
protected static java.lang.String get2ndString(java.lang.String line,
java.lang.String commandsFileName)
public static double getd(java.lang.String key)
public static int geti(java.lang.String key)
public static boolean getb(java.lang.String key)
public static boolean verbose()
public static boolean debug()
public static java.util.Random randomNumberGenerator()
public java.lang.String toString()
toString in class java.lang.Objectprotected static void initRandom()
public static void initRandom(int seed)
protected static int initRandom(java.lang.String[] argv)
public static java.lang.String about()
private static java.lang.String getCommandLine(java.lang.String[] args)
public static void printGlobalTable()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||