|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpeakml.io.peakml.PeakMLParser
public class PeakMLParser
Central class for parsing PeakML type files. All access to the parser is handled
with static access functions, so no instance should be made (and indeed can be
made, as the default constructor is hidden). As a rule all access functions return an
instance of the ParseResult filled with the header and peak information. Also,
each of the parse-functions can be plugged with ParserProgressListener)
instance, which is used to update on the progress of parsing. Only
parse(InputStream, ParserProgressListener, boolean)
forms the exception to these rules, as this function utilizes the
PeakMLProgressListener as the mechanism to return the results to the user.
IPeak subclass (e.g. PeakMLParser#parseCentroids(InputStream, ParserProgressListener)).
Use these functions with caution and only when you are sure the file in
question contains only these types of peaks or you want to enforce this to be
the case. When such an access-function encounters a different IPeak subclass
than expected and exception is thrown.
The alternative is to use one of the parse-functions (i.e. the name of the function
is parse), which will handle all types of IPeak subclasses and return
the peaks as IPeak (with the class information mechanism of Java one can find
out the exact type). These functions also allow you to define whether to load
all data associated to an IPeak subclass, or only to load the general
IPeak data. When only the data IPeak data is needed it will
yield a performance boost in memory consumption.
| Method Summary | |
|---|---|
static ParseResult |
parse(java.io.InputStream in,
boolean loadall)
Parse function for blindly loading data from a PeakML file. |
static ParseResult |
parse(java.io.InputStream in,
ParserProgressListener listener,
boolean loadall)
Parse function for blindly loading data from a PeakML file. |
static void |
parse(java.io.InputStream in,
PeakMLProgressListener listener,
boolean loadall)
Parse function for blindly loading data from a PeakML file. |
static ParseResult |
parseBackgroundIons(java.io.InputStream in,
ParserProgressListener listener)
Parse function for loading a PeakML file containing only backgroundion entries. |
static ParseResult |
parseIPeakSet(java.io.InputStream in,
ParserProgressListener listener)
Parse function for loading a PeakML file containing only peakset entries (containing other types of entries). |
static ParseResult |
parseMassChromatograms(java.io.InputStream in,
ParserProgressListener listener)
Parse function for loading a PeakML file containing only masschromatogram entries. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static ParseResult parse(java.io.InputStream in,
boolean loadall)
throws java.io.IOException,
domsax.XmlParserException
parse(InputStream, ParserProgressListener, boolean) with
the parameter listener set to null.
in - The input-stream to load the data from.loadall - If set to false only the data known to IPeak is loaded as class Peak.
java.io.IOException - Thrown on an IOException.
domsax.XmlParserException - Thrown when an unknown IPeak object is encountered.
public static ParseResult parse(java.io.InputStream in,
ParserProgressListener listener,
boolean loadall)
throws java.io.IOException,
domsax.XmlParserException
ParseResult instance is parameterized with IPeak. The class-information
made available through the Java language can be used to determine the original
type of the peak. The function employs a callback mechanism with
ParserProgressListener to return information about the progress through
the file. This is calculated with the information returned by
Header.getNrPeaks().
The loadall parameter can be used to restrict the amount of data actually being
loaded by the function. If this is set to false only data known by the IPeak
class is loaded (in this implementation this means that an instance of the
Centroid is made). The class information cannot be used to determine the
original type of the peak when loadall is set to false.
in - The input-stream to load the data from.listener - The progress listener.loadall - If set to false only the data known to IPeak is loaded as class Peak.
java.io.IOException - Thrown on an IOException.
domsax.XmlParserException - Thrown when an unknown IPeak object is encountered.
public static void parse(java.io.InputStream in,
PeakMLProgressListener listener,
boolean loadall)
throws java.io.IOException,
domsax.XmlParserException
parse(InputStream, PeakMLProgressListener, boolean)
except that it uses the PeakMLProgressListener interface as a callback
mechanism to return the header and peak-information. As all data is returned
through this the method does not have a return-value.
in - The input-stream to load the data from.listener - The parser listener, which is used as a callback mechanism to deliver header and peak information.loadall - If set to false only the data known to IPeak is loaded as class Peak.
java.io.IOException - Thrown on an IOException.
domsax.XmlParserException - Thrown when an unknown IPeak object is encountered.
public static ParseResult parseMassChromatograms(java.io.InputStream in,
ParserProgressListener listener)
throws java.io.IOException,
domsax.XmlParserException
XmlParserException is thrown. The resulting
ParseResult instance is type-bound to MassChromatogram to force only masschromatogram types.
in - The input-stream to load the data from.
java.io.IOException - Thrown on an IOException.
domsax.XmlParserException - Thrown when an unknown IPeak object is encountered.
public static ParseResult parseBackgroundIons(java.io.InputStream in,
ParserProgressListener listener)
throws java.io.IOException,
domsax.XmlParserException
XmlParserException is thrown. The resulting
ParseResult instance is type-bound to BackgroundIon to force only backgroundion types.
in - The input-stream to load the data from.
java.io.IOException - Thrown on an IOException.
domsax.XmlParserException - Thrown when an unknown IPeak object is encountered.
public static ParseResult parseIPeakSet(java.io.InputStream in,
ParserProgressListener listener)
throws java.io.IOException,
domsax.XmlParserException
XmlParserException
is thrown. The resulting ParseResult instance is type-bound to IPeakSet to force
only peakset types.
in - The input-stream to load the data from.
domsax.XmlParserException - Thrown when an unknown IPeak object is encountered.
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||