jgromacs.data
Class Trajectory

java.lang.Object
  extended by jgromacs.data.Trajectory
All Implemented Interfaces:
java.lang.Cloneable

public class Trajectory
extends java.lang.Object
implements java.lang.Cloneable

Objects of this class represent a single trajectory


Constructor Summary
Trajectory()
          Constructs a new Trajectory object
Trajectory(java.lang.String name)
          Constructs a new Trajectory object of given name
Trajectory(Structure structure)
          Constructs a new Trajectory object of given structure
Trajectory(Structure[] ensemble)
          Constructs a new Trajectory object made from an ensemble of structures
 
Method Summary
 void addFrame(PointList frame)
          Adds a new frame to the trajectory
 java.lang.Object clone()
          Returns an identical Trajectory object
 double convertFrameIndexToTime(int frameindex)
          Converts frame index to simulation time
 int convertTimeToFrameIndex(double time)
          Converts simulation time to frame index
 boolean equals(java.lang.Object other)
          Returns true if the two trajectories are identical
 PointList getFirstFrameAsPointList()
          Returns the initial frame of trajectory as a PointList
 Structure getFirstFrameAsStructure()
          Returns the initial frame of trajectory as a Structure
 PointList getFrameAsPointList(int i)
          Returns frame #i of the trajectory as a PointList object
 Structure getFrameAsStructure(int i)
          Returns frame #i of the trajectory as a Structure object
 java.util.ArrayList<PointList> getFrames()
          Returns frames of the trajectory as an ArrayList object
 PointList getLastFrameAsPointList()
          Returns the last frame of trajectory as a PointList
 Structure getLastFrameAsStructure()
          Returns the last frame of trajectory as a Structure
 PointList getMeanFrame()
          Returns the mean frame of trajectory
 java.lang.String getName()
          Returns the name of trajectory
 int getNumberOfAtoms()
          Returns the number of atoms in the trajectory
 int getNumberOfFrames()
          Returns the number of frames in the trajectory
 int getNumberOfResidues()
          Returns the number of residues in the trajectory
 double getStartTime()
          Returns the start time of trajectory
 Trajectory getSubTrajectory(FrameIndexSet framelist)
          Returns the subtrajectory defined by the given frame list
 Trajectory getSubTrajectory(IndexSet indices)
          Returns the subtrajectory defined by the given index set
 Trajectory getSubTrajectory(int startframe, int endframe)
          Returns the subtrajectory between the given start and end frames
 Trajectory getSubTrajectory(int startframe, int endframe, int frequency)
          Returns the subtrajectory between the given start and end frames using the given sampling frequency
 double getTimeStep()
          Returns the time step of trajectory
 int hashCode()
          Returns hash code
 void removeFrame(int i)
          Removes frame #i from the trajectory
 void setFrame(int i, PointList frame)
          Replaces frame #i with a new frame
 void setName(java.lang.String name)
          Sets the name of trajectory
 void setStartTime(double startTime)
          Sets the start time of trajectory
 void setStructure(Structure structure)
          Sets the structure described by the trajectory
 void setTimeStep(double timeStep)
          Sets the time step of trajectory
 java.lang.String toString()
          Returns the String representation of trajectory
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Trajectory

public Trajectory()
Constructs a new Trajectory object


Trajectory

public Trajectory(java.lang.String name)
Constructs a new Trajectory object of given name


Trajectory

public Trajectory(Structure structure)
Constructs a new Trajectory object of given structure


Trajectory

public Trajectory(Structure[] ensemble)
Constructs a new Trajectory object made from an ensemble of structures

Method Detail

getFrames

public java.util.ArrayList<PointList> getFrames()
Returns frames of the trajectory as an ArrayList object

Returns:
frames as an ArrayList

getFrameAsPointList

public PointList getFrameAsPointList(int i)
Returns frame #i of the trajectory as a PointList object

Returns:
frame #i as a PointList

getFrameAsStructure

public Structure getFrameAsStructure(int i)
Returns frame #i of the trajectory as a Structure object

Returns:
frame #i as a Structure

getNumberOfFrames

public int getNumberOfFrames()
Returns the number of frames in the trajectory

Returns:
number of frames

getName

public java.lang.String getName()
Returns the name of trajectory

Returns:
name of trajectory

setName

public void setName(java.lang.String name)
Sets the name of trajectory

Parameters:
name - name of trajectory

getStartTime

public double getStartTime()
Returns the start time of trajectory

Returns:
start time of trajectory

setStartTime

public void setStartTime(double startTime)
Sets the start time of trajectory

Parameters:
startTime - start time of trajectory

getTimeStep

public double getTimeStep()
Returns the time step of trajectory

Returns:
time step of trajectory

setTimeStep

public void setTimeStep(double timeStep)
Sets the time step of trajectory

Parameters:
timeStep - time step of trajectory

setStructure

public void setStructure(Structure structure)
Sets the structure described by the trajectory

Parameters:
structure - structure described by the trajectory

getMeanFrame

public PointList getMeanFrame()
Returns the mean frame of trajectory

Returns:
mean frame

getNumberOfAtoms

public int getNumberOfAtoms()
Returns the number of atoms in the trajectory

Returns:
number of atoms

getNumberOfResidues

public int getNumberOfResidues()
Returns the number of residues in the trajectory

Returns:
number of residues

getFirstFrameAsPointList

public PointList getFirstFrameAsPointList()
Returns the initial frame of trajectory as a PointList

Returns:
initial frame

getFirstFrameAsStructure

public Structure getFirstFrameAsStructure()
Returns the initial frame of trajectory as a Structure

Returns:
initial frame

getLastFrameAsPointList

public PointList getLastFrameAsPointList()
Returns the last frame of trajectory as a PointList

Returns:
last frame

getLastFrameAsStructure

public Structure getLastFrameAsStructure()
Returns the last frame of trajectory as a Structure

Returns:
last frame

addFrame

public void addFrame(PointList frame)
Adds a new frame to the trajectory

Parameters:
frame - new frame

removeFrame

public void removeFrame(int i)
Removes frame #i from the trajectory


setFrame

public void setFrame(int i,
                     PointList frame)
Replaces frame #i with a new frame

Parameters:
frame - new frame

convertFrameIndexToTime

public double convertFrameIndexToTime(int frameindex)
Converts frame index to simulation time

Parameters:
frameindex - frame index
Returns:
simulation time

convertTimeToFrameIndex

public int convertTimeToFrameIndex(double time)
Converts simulation time to frame index

Parameters:
time - simulation time
Returns:
frame index

getSubTrajectory

public Trajectory getSubTrajectory(int startframe,
                                   int endframe)
Returns the subtrajectory between the given start and end frames

Parameters:
startframe - start frame
endframe - end frame
Returns:
subtrajectory

getSubTrajectory

public Trajectory getSubTrajectory(int startframe,
                                   int endframe,
                                   int frequency)
Returns the subtrajectory between the given start and end frames using the given sampling frequency

Parameters:
startframe - start frame
endframe - end frame
frequency - sampling frequency
Returns:
subtrajectory

getSubTrajectory

public Trajectory getSubTrajectory(IndexSet indices)
Returns the subtrajectory defined by the given index set

Parameters:
indices - index set of subtrajectory
Returns:
subtrajectory

getSubTrajectory

public Trajectory getSubTrajectory(FrameIndexSet framelist)
Returns the subtrajectory defined by the given frame list

Parameters:
framelist - frame list
Returns:
subtrajectory

toString

public java.lang.String toString()
Returns the String representation of trajectory

Overrides:
toString in class java.lang.Object
Returns:
String representation

equals

public boolean equals(java.lang.Object other)
Returns true if the two trajectories are identical

Overrides:
equals in class java.lang.Object
Parameters:
other - the other trajectory

hashCode

public int hashCode()
Returns hash code

Overrides:
hashCode in class java.lang.Object

clone

public java.lang.Object clone()
Returns an identical Trajectory object

Overrides:
clone in class java.lang.Object
Returns:
clone of the trajectory