meshi.util
Class CommandList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<Command>
              extended by meshi.util.CommandList
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Command>, java.util.Collection<Command>, java.util.List<Command>, java.util.RandomAccess, KeyWords

public class CommandList
extends java.util.ArrayList<Command>
implements KeyWords

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.
 

See Also:
Serialized Form

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
 
Fields inherited from interface meshi.util.KeyWords
AA_SEQUENCE, ACCESIBILITY_SEQUENCE, ALINMENT_FILE_PATH, ALL_CA, ALPHA_ANGLE_ENERGY, ALPHA_TORSION_ENERGY, ANGLE_ENERGY, ANGLE_X, ANGLE_Z, ATOMIC_PAIRWISE_PMF_SUMMA_ENERGY, BEAUTIFY_PROBLEMATIC_RANGE, BFGS, BOND_ENERGY, BUFFER_SIZE, CA_CLASH_DISTANCE, CA_LONG_DISTANCE, CA_MODEL, CA_SHORT_DISTANCE, CA_TETHER_ENERGY, CALPHA_HYDROGEN_BONDS, CALPHA_HYDROGEN_BONDS_PLANE, CASP_GROUP, CG, CHECK_INTERLOOP_DISTANCE, CLASH_DISTANCE, COMPOSITE_PROPENSITY_ENERGY, CONSENSUS_ENERGY, CONSTRICT, COOPERATIVE_ATOMIC_PAIRWISE_PMF_SUMMA_ENERGY, COOPERATIVE_ATOMIC_PAIRWISE_PMF_SUMMA_FILENAME, COOPERATIVE_PERATOM_SUMMA_ENERGY, COOPERATIVE_PERATOM_SUMMA_FILENAME, COOPERATIVE_PROPENSITY_ENERGY, COOPERATIVE_PROPENSITY_FILENAME, COOPERATIVE_RAMACHANDRAN_ENERGY, COOPERATIVE_RAMACHANDRAN_FILENAME, COOPERATIVE_Z_PROPENSITY_ENERGY, COOPERATIVE_Z_PROPENSITY_FILENAME, COOPERATIVE_Z_RAMACHANDRAN_ENERGY, COOPERATIVE_Z_RAMACHANDRAN_FILENAME, COOPERATIVE_Z_SUMMA_ENERGY, COOPERATIVE_Z_SUMMA_FILENAME, CORPUS_FILE_NAME, CSAonly_FILES_LOCATION_PATH, CUTOFF, CYLINDER_ENERGY, DICTIONARY_KEY, DIELECTRIC_CONSTANT, DISTANCE_CONSTRAINT_PCA, DISTANCE_CONSTRAINTS_ENERGY, DISTANCE_CONSTRAINTS_MASK, DISTANCE_FROM_CENTROID_ENERGY, DRESSER_FRAGMENTS, EDM_ENERGY, EDM_ENERGY_FILE_NAME, ELECTROSTATICS, END, EXCLUDED_VOL, FINAL_TEMPERATURE, FIX_C_TERMINAL, FIX_N_TERMINAL, FLAT_RAMACH_ENERGY, FREE_FINAL_MINIMIZATION, GRID_EDGE, HYDROGEN_BONDS, HYDROGEN_BONDS_ANGLES, HYDROGEN_BONDS_PAIRS, HYDROGEN_BONDS_PLANE, INFLATE_ENERGY, INITIAL_TEMPERATURE, INPUT_FILE, INTER_SEGMENT_FACTOR, INTER_SEGMENT_TOLERANCE, INTRA_SEGMENT_FACTOR, INTRA_SEGMENT_TOLERANCE, ITERATIONS_ALLATOM, ITERATIONS_BACKBONE, ITERATIONS_CA, KEY_KEY, KOEHL_FILE, LBFGS, LENNARD_JONES, LENNARD_JONES_CA, LINEAR_RG, LOOP1, LOOP2, LOOSEN_EDGE_LENGTH, MAX_ANGLE, MAX_CLASHES, MAX_DISTANCE, MAX_RUN_TIME, MAX_STEPS, MAX_WIDTH_OF_HAIRPIN, MCM, MCM_PERTURBATION, MESHILOG_KEY, METHOD, MIN_WIDTH_OF_HAIRPIN, MINIMIZATION_LOOP, MINIMIZE, MODE, MODEL, MODEL_DSSP, MODEL_NUMBER, N_ATOMS, N_TRIES, NON_FROZEN_BOND_DEPTH, NON_FROZEN_RADIUS, NONE, NUMBER, NUMBER_OF_CA_ITERATIONS, NUMBER_OF_CHAINS, NUMBER_OF_MODELS, NUMBER_OF_RUNS, OFF, ON, OPTIMIZER, OUT_OFPLANE_ENERGY, OUTPUT_FILE_NAME, OUTPUT_FILE_PATH, PARAMETERS_DIRECTORY, PDB_FILE, PLANE_ENERGY, PROPENSITY_TORSION_ENERGY, R_MAX, RAMACHANDRAN_SIDECHAIN_ENERGY, REFERENCE, RELAX, REPORT_EVERY, RESTART_EVERY, RMS_TARGET, ROTAMER_LIBRARY, SATURATION, SECONDARY_STRUCTURE, SEED, SEQUENCE, SHOTGUN_MODEL, SMOOTH_ROTAMER_LIBRARY_ENERGY, SOLVATE_ENERGY, SS_NAME, SS_SEQUENCE, STEEPEST_DECENT, STEPS, STRICT_CLASHES, STRUCTURE_NAMES, SUPERIMPOSE, SYMMETRY_ENERGY, TARGET_FILE_PATH, TARGET_NAME, TARGET_SEQUENCE, TEMPLATE_DISTANCE_CONSTRAINTS, TEMPLATE_DSSP, TEMPLATE_ENERGY, TEMPLATE_FILE_PATH, TEMPLATE_NAME, TEMPLATE_STRUCTURE, TEMPLATE_TARGET_ALIGNMENT, TETHER_ENERGY, TOLERANCE, TOPOLOGY_MAP, TWO_TORSIONS_ENERGY, UN_WARP_ENERGY, UNSATISFIED_CUTTOF, UP_TO_CUTOFF, USE_FAST_ARCCOS, VALUE_KEY, VOLUME_CONSTRAINT, WARP_ENERGY, WARP_STEP_SIZE, WARP_THRESHOLD, WEIGHT, WIDTH_OF_HAIRPIN
 
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

comment

private java.lang.String comment
The file from which the comands were read. Usefull for debugging.


debug

private boolean debug

commandsException

private CommandsException commandsException
Constructor Detail

CommandList

public CommandList(CommandsException commandsException)
An empty commands List,


CommandList

public CommandList(java.lang.String[] args,
                   CommandsException commandsException)
Constract a CommandList object from a file. The rules for the command file format are: empty lines - ignored line starting with the "#" char - ignored, and used for commenting other cases - the first word in the line serves as the key word

Parameters:
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.

CommandList

public CommandList(java.lang.String fileName,
                   CommandsException commandsException)
Method Detail

comment

private void comment(java.lang.String s)

firstWordFilter

public CommandList firstWordFilter(Key key)

firstWordFilter

public CommandList firstWordFilter(java.lang.String key)
Generates a list including only the commands starting with a given keyword. Used to extract all the commands relevant to some module.


keyExists

public boolean keyExists(Key key)
Testing if some key exists


keyExists

public boolean keyExists(java.lang.String key)
Testing if some key is exists


keyExists

public boolean keyExists(Key key,
                         Key key2)
Testing if a combined key exists


keyExists

public boolean keyExists(java.lang.String key,
                         java.lang.String key2)
Testing if a combined key exists


firstWord

public Command firstWord(Key key)
Returns the first command that start with the given keyword.


firstWord

public Command firstWord(java.lang.String key)
Returns the first command that start with the given keyword.


secondWord

public Command secondWord(Key key)
Returns the first command that whose second word is the given keyword.


secondWord

public Command secondWord(java.lang.String key)
Returns the first command that whose second word is the given keyword.


getWeight

public double getWeight(Key key)
Gets energy term weight getWeight. If the following line occur in the command file: VDW weight 8.5 then getWeight("VDW") returns 8.5


getWeight

public double getWeight(java.lang.String key)
Gets energy term weight getWeight. If the following line occur in the command file: VDW weight 8.5 then getWeight("VDW") returns 8.5


comment

public java.lang.String comment()

printCommandsLines

public void printCommandsLines(MeshiWriter writer)