|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Command>
meshi.util.CommandList
public class CommandList
Command File Parser.
MESHI programs require a large number of user defined parameters (e.g. weights for the energy terms). The user provide these parameters through a single command file encoded in a very simple format. The CommandList class reads this file, parses it, stores the commands and provide them to the other classes.
| Field Summary | |
|---|---|
private CommandsException |
commandsException
|
private java.lang.String |
comment
The file from which the comands were read. |
private boolean |
debug
|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
CommandList(CommandsException commandsException)
An empty commands List, |
|
CommandList(java.lang.String[] args,
CommandsException commandsException)
Constract a CommandList object from a file. |
|
CommandList(java.lang.String fileName,
CommandsException commandsException)
|
|
| Method Summary | |
|---|---|
java.lang.String |
comment()
|
private void |
comment(java.lang.String s)
|
Command |
firstWord(Key key)
Returns the first command that start with the given keyword. |
Command |
firstWord(java.lang.String key)
Returns the first command that start with the given keyword. |
CommandList |
firstWordFilter(Key key)
|
CommandList |
firstWordFilter(java.lang.String key)
Generates a list including only the commands starting with a given keyword. |
double |
getWeight(Key key)
Gets energy term weight getWeight. |
double |
getWeight(java.lang.String key)
Gets energy term weight getWeight. |
boolean |
keyExists(Key key)
Testing if some key exists |
boolean |
keyExists(Key key,
Key key2)
Testing if a combined key exists |
boolean |
keyExists(java.lang.String key)
Testing if some key is exists |
boolean |
keyExists(java.lang.String key,
java.lang.String key2)
Testing if a combined key exists |
void |
printCommandsLines(MeshiWriter writer)
|
Command |
secondWord(Key key)
Returns the first command that whose second word is the given keyword. |
Command |
secondWord(java.lang.String key)
Returns the first command that whose second word is the given keyword. |
| Methods inherited from class java.util.ArrayList |
|---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Field Detail |
|---|
private java.lang.String comment
private boolean debug
private CommandsException commandsException
| Constructor Detail |
|---|
public CommandList(CommandsException commandsException)
public CommandList(java.lang.String[] args,
CommandsException commandsException)
args - A String array (typicaly the main parameter).
The Commands file name is expected to be the first element in this array.
If the array is of length zero or strats with the String "-help", the method usageMessage() of the
commandsException is called.commandsException - will take care of problems that arise during commands processing.
public CommandList(java.lang.String fileName,
CommandsException commandsException)
| Method Detail |
|---|
private void comment(java.lang.String s)
public CommandList firstWordFilter(Key key)
public CommandList firstWordFilter(java.lang.String key)
public boolean keyExists(Key key)
public boolean keyExists(java.lang.String key)
public boolean keyExists(Key key,
Key key2)
public boolean keyExists(java.lang.String key,
java.lang.String key2)
public Command firstWord(Key key)
public Command firstWord(java.lang.String key)
public Command secondWord(Key key)
public Command secondWord(java.lang.String key)
public double getWeight(Key key)
public double getWeight(java.lang.String key)
public java.lang.String comment()
public void printCommandsLines(MeshiWriter writer)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||