gov.nih.nci.caarray.services.fileparse2.parsers
Class MicroarrayTextFileHeaderParser
java.lang.Object
gov.nih.nci.caarray.services.fileparse2.parsers.BaseMicroarrayFileHeaderParser
gov.nih.nci.caarray.services.fileparse2.parsers.MicroarrayTextFileHeaderParser
- Direct Known Subclasses:
- ArrayDesignTextFileHeaderParser
public class MicroarrayTextFileHeaderParser
- extends BaseMicroarrayFileHeaderParser
- Author:
- tranp
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
headerEndMarkerPattern_
protected java.lang.String headerEndMarkerPattern_
MicroarrayTextFileHeaderParser
public MicroarrayTextFileHeaderParser(DataSetMapper dataSetMapper)
- Constructs a parser to parse a text file's header section. This
constructor assumes the string pattern for detecting where the header
section ends is the data table's column header line specified in
the specified
DataSetMapper
.
- Parameters:
dataSetMapper
-
MicroarrayTextFileHeaderParser
public MicroarrayTextFileHeaderParser(DataSetMapper dataSetMapper,
java.lang.String headerEndMarkerPattern)
- Constructs a parser to parse a text file's header section. This
constructor uses the specified
headerEndMarkerPattern
to
recognize the end of the header section in the file starting from
the top of the file.
- Parameters:
dataSetMapper
- headerEndMarkerPattern
- - Specifying the pattern of the line
at which the file's header section ends.
parse
public void parse(SequenceInputFile inputFile)
throws java.io.IOException
- Specified by:
parse
in class BaseMicroarrayFileHeaderParser
- Throws:
java.io.IOException
validate
public boolean validate(SequenceInputFile inputFile,
boolean resetPointerAfterDone)
throws java.io.IOException
- Description copied from class:
BaseMicroarrayFileHeaderParser
- Validates the file if it's the right one before proceeding further. The
typical implementation for this is to look at some parameters in the
file's header and match certain string. However, anything could be
performed to prevent the file from further processing. When this method
returns, the file pointer could be repositioned to where it was before
the method is invoked so the data can be re-read by passing
true
for the argument resetPointerAfterDone
.
- Specified by:
validate
in class BaseMicroarrayFileHeaderParser
- Returns:
-
- Throws:
java.io.IOException
extractHeaderSection
protected java.lang.StringBuffer extractHeaderSection(SequenceInputFile inputFile)
throws java.io.IOException
- Throws:
java.io.IOException
matchHeaderEndMarkerPattern
protected boolean matchHeaderEndMarkerPattern(java.lang.String text)
match
protected boolean match(java.lang.String pattern,
java.lang.String input)
getMatch
protected org.apache.oro.text.regex.MatchResult getMatch()
main
public static void main(java.lang.String[] args)
throws java.io.IOException
- Throws:
java.io.IOException