io
Class TrajectoryWriter

java.lang.Object
  extended byio.TrajectoryWriter
Direct Known Subclasses:
OutPDB, OutPosG96, OutTrajG96, OutVMDAM, OutXPlor

public abstract class TrajectoryWriter
extends java.lang.Object

Author:
vincent

Field Summary
(package private)  java.lang.String fileName
           
protected  java.io.OutputStreamWriter outFile
           
 
Constructor Summary
TrajectoryWriter(java.lang.String title)
           
TrajectoryWriter(java.lang.String fName, java.lang.String title)
           
 
Method Summary
static TrajectoryWriter getWriter(java.lang.String format, java.lang.String title)
          Get a trajectory writer for a given output format.
abstract  void writeFrame(double time, int step, double[][] positions, double[] box, java.lang.String[] atomNames, java.lang.String[] residueNames, int[] residueNumbers)
          Format-agnostic trajectory writer.
abstract  void writeTitle(java.lang.String title)
          write more or less proper header information (author, title...)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileName

java.lang.String fileName

outFile

protected java.io.OutputStreamWriter outFile
Constructor Detail

TrajectoryWriter

public TrajectoryWriter(java.lang.String title)
                 throws java.io.IOException
Parameters:
title - the pdb title block
Throws:
java.io.IOException

TrajectoryWriter

public TrajectoryWriter(java.lang.String fName,
                        java.lang.String title)
                 throws java.io.IOException
Parameters:
fName - the file name
title - the pdb title block
Throws:
java.io.IOException
Method Detail

writeTitle

public abstract void writeTitle(java.lang.String title)
                         throws java.io.IOException
write more or less proper header information (author, title...)

Parameters:
title - the title block
Throws:
java.io.IOException

writeFrame

public abstract void writeFrame(double time,
                                int step,
                                double[][] positions,
                                double[] box,
                                java.lang.String[] atomNames,
                                java.lang.String[] residueNames,
                                int[] residueNumbers)
                         throws java.io.IOException
Format-agnostic trajectory writer. Since every format actually writes different things, we have to supply all information that might be required by any format... the implementation of simpler custom interfaces is up to the respective writer implementations.

Parameters:
time - the time of the frame
step - corresponds to a given time step (g96, vmd) or model serial (pdb)
positions - the 3N coordinates
box - the 3 box dimensions (ignored by pdb)
atomNames - the N atom names
residueNames - the N residue names of the atoms
residueNumbers - the N residue numbers of the atoms
Throws:
java.io.IOException

getWriter

public static TrajectoryWriter getWriter(java.lang.String format,
                                         java.lang.String title)
                                  throws java.io.IOException
Get a trajectory writer for a given output format.

Parameters:
format - the desired output format.
title - title to be written.
Returns:
appropriate trajectoryWriter
Throws:
java.io.IOException