peakml.io
Class MeasurementInfo

java.lang.Object
  extended by peakml.Annotatable
      extended by peakml.io.MeasurementInfo

public class MeasurementInfo
extends Annotatable

Central point for collecting all information about a measurement. For this a collection of FileInfo instances is maintained, describing all the files associated to the measurement. Furthermore, a list with ScanInfo instances is maintained, describing all the scans.

For this class it has been chosen to stick to integer id's, because each IPeak descendants maintain this id. A string representation would be too expensive in terms of memory consumption.


Constructor Summary
MeasurementInfo(int id, MeasurementInfo other)
          Copy-constructor which copies the contents of the given measurement information into this instance.
MeasurementInfo(int id, java.lang.String sampleid)
          Constructs a new measurement information with the given id of the measurement and the given id of the sample.
 
Method Summary
 void addFileInfo(FileInfo file)
          Adds the file info instance to the list of file infos.
 void addFileInfos(java.util.Collection<FileInfo> files)
          Adds the collection of file infos to the list of file infos.
 void addScanInfo(ScanInfo scan)
          Adds the scan info instance to the list of scan infos.
 void addScanInfos(java.util.Collection<ScanInfo> scans)
          Adds the collection of scan infos to the list of scan infos.
 FileInfo getFileInfo(int index)
          Returns the file info instance at the given index.
 java.util.Vector<FileInfo> getFileInfos()
          Returns all the file info instances maintained in this class.
 int getID()
          Returns the id of the measurement.
 java.lang.String getLabel()
          Returns the optional label for the measurement.
 double getMaxRetentionTime()
           
 double getMinRetentionTime()
           
 int getNrFileInfos()
          Returns the number of file info instances maintained within this class.
 int getNrScanInfos()
          Returns the number of scan info instances maintained within this class.
 java.lang.String getSampleID()
          Returns the id of the sample associated to the measurement.
 ScanInfo getScanInfo(int index)
          Returns the scan info instance at the given index.
 java.util.Vector<ScanInfo> getScanInfos()
          Returns all the scan info instances maintained in this class.
 boolean getVisible()
          For more information see setVisible(boolean).
 void setLabel(java.lang.String label)
          Sets the optional label for the measurement.
 void setVisible(boolean b)
          Convenience function for user interface applications to keep track off whether to show this measurement or not.
 
Methods inherited from class peakml.Annotatable
addAnnotation, addAnnotation, addAnnotation, addAnnotation, addAnnotation, addAnnotations, getAnnotation, getAnnotations, removeAllAnnotations, removeAnnotation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MeasurementInfo

public MeasurementInfo(int id,
                       java.lang.String sampleid)
Constructs a new measurement information with the given id of the measurement and the given id of the sample.

Parameters:
id - The id of the measurement.
sampleid - The id of the associated sample.

MeasurementInfo

public MeasurementInfo(int id,
                       MeasurementInfo other)
Copy-constructor which copies the contents of the given measurement information into this instance. The given id is used as the id of this measurement.

Parameters:
id - The id of the measurement.
other - The measurement information to be copied.
Method Detail

getID

public int getID()
Returns the id of the measurement. This id links to all the ipeak-data associated with this measurement (the method IPeak.getMeasurementID() returns the id) and can be used to locate the measurement info instance in the Header.

Returns:
The id of the measurement.

getSampleID

public java.lang.String getSampleID()
Returns the id of the sample associated to the measurement. This id links to the associated sample info (the method Header.getSampleInfo(String) returns the SampleInfo}.

Returns:
The sample info linked to this measurement.

setLabel

public void setLabel(java.lang.String label)
Sets the optional label for the measurement. This label is used for display purposes in user interface environments.

Parameters:
label - The new label.

getLabel

public java.lang.String getLabel()
Returns the optional label for the measurement. This label is used for display purposes in user interface environments.

Returns:
The optional label for the measurement.

setVisible

public void setVisible(boolean b)
Convenience function for user interface applications to keep track off whether to show this measurement or not.

Parameters:
b - Boolean indicating show or not.

getVisible

public boolean getVisible()
For more information see setVisible(boolean).

Returns:
Boolean indicating show or not.

addFileInfo

public void addFileInfo(FileInfo file)
Adds the file info instance to the list of file infos. No checking is performed to ensure that the file info is not already in the list.

Parameters:
file - The new file info instance.

addFileInfos

public void addFileInfos(java.util.Collection<FileInfo> files)
Adds the collection of file infos to the list of file infos.

Parameters:
files - The collection of file infos.

getFileInfo

public FileInfo getFileInfo(int index)
                     throws java.lang.IndexOutOfBoundsException
Returns the file info instance at the given index.

Parameters:
index - The index of the file info to be retrieved.
Returns:
The file info instance.
Throws:
java.lang.IndexOutOfBoundsException - Thrown when the given index is not within the bounds of the list.

getFileInfos

public java.util.Vector<FileInfo> getFileInfos()
Returns all the file info instances maintained in this class.

Returns:
The file info instances.

getNrFileInfos

public int getNrFileInfos()
Returns the number of file info instances maintained within this class.

Returns:
The number of file info instances.

addScanInfo

public void addScanInfo(ScanInfo scan)
Adds the scan info instance to the list of scan infos. No checking is performed to ensure that the scan info is not already in the list.

Parameters:
scan - The new scan info instance.

addScanInfos

public void addScanInfos(java.util.Collection<ScanInfo> scans)
Adds the collection of scan infos to the list of scan infos.

Parameters:
scans - The collection of scan infos.

getScanInfo

public ScanInfo getScanInfo(int index)
                     throws java.lang.IndexOutOfBoundsException
Returns the scan info instance at the given index.

Parameters:
index - The index of the scan info to be retrieved.
Returns:
The scan info instance.
Throws:
java.lang.IndexOutOfBoundsException - Thrown when the given index is not within the bounds of the list.

getScanInfos

public java.util.Vector<ScanInfo> getScanInfos()
Returns all the scan info instances maintained in this class.

Returns:
The scan info instances.

getNrScanInfos

public int getNrScanInfos()
Returns the number of scan info instances maintained within this class.

Returns:
The number of scan info instances.

getMinRetentionTime

public double getMinRetentionTime()

getMaxRetentionTime

public double getMaxRetentionTime()