org.systemsbiology.jrap.stax
Class MSXMLParser

java.lang.Object
  extended by org.systemsbiology.jrap.stax.MSXMLParser

public final class MSXMLParser
extends java.lang.Object

A generic utility class for reading an MSXML file in a random access fashion and utilizing a stored scan index for fast reads.


Field Summary
protected  long chrogramIndex
           
protected  java.lang.String fileName
          The file we are in charge of reading
protected  boolean isML
           
protected  boolean isXML
           
protected  int maxScan
           
protected  java.util.Map<java.lang.Integer,java.lang.Long> offsets
          The indexes
 
Constructor Summary
MSXMLParser(java.lang.String fileName)
           
 
Method Summary
 int getMaxScanNumber()
           
 int getScanCount()
          Get the total number of scans in the mzXMLfile handled by this parser.
 long getScanOffset(int scanNumber)
          get scan offset, scan number is 1 based.
 Scan rap(int scanNumber)
          Read a particular scan from a MSXML file and return a generic Scan object with it's data.
 MZXMLFileInfo rapFileHeader()
          this gives back the file header (info before scan)
 ScanHeader rapHeader(int scanNumber)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fileName

protected java.lang.String fileName
The file we are in charge of reading


offsets

protected java.util.Map<java.lang.Integer,java.lang.Long> offsets
The indexes


maxScan

protected int maxScan

chrogramIndex

protected long chrogramIndex

isXML

protected boolean isXML

isML

protected boolean isML
Constructor Detail

MSXMLParser

public MSXMLParser(java.lang.String fileName)
Method Detail

rapFileHeader

public MZXMLFileInfo rapFileHeader()
this gives back the file header (info before scan)

Returns:
the file header info (MZXMLFileInfo)

rapHeader

public ScanHeader rapHeader(int scanNumber)
Returns:
a scan header object without peaks information.

rap

public Scan rap(int scanNumber)
Read a particular scan from a MSXML file and return a generic Scan object with it's data. Note: scanNumbers are 1-based, so scanNumber must be at least 1 and be not greater than getScanCount() + 1

Returns:
a scan object. It has all the infomation in a scanheader object and also peaks information that doesn't included in scanHeader object.

getScanCount

public int getScanCount()
Get the total number of scans in the mzXMLfile handled by this parser.

Returns:
The number of scans.

getMaxScanNumber

public int getMaxScanNumber()

getScanOffset

public long getScanOffset(int scanNumber)
get scan offset, scan number is 1 based.