Class BasicLineMapParser<K,T>
java.lang.Object
ubic.gemma.core.loader.util.parser.BasicLineMapParser<K,T>
- All Implemented Interfaces:
LineParser<T>
,Parser<T>
- Direct Known Subclasses:
AffyProbeReader
,IlluminaProbeReader
,LineMapParser
,NcbiGeneEnsemblFileParser
,NcbiGeneHistoryParser
,NcbiGeneInfoParser
,ProbeSequenceParser
,TaxonParser
A line parser that produces a Map instead of a Collection. Subclasses must provide a method to generate keys, which
is generated from the values. A typical use case of this is when the keys are also known to another class that needs
the data provided by the parser; to locate the data it uses the key.
- Author:
- pavlidis
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
Lines starting with this will be ignored.protected final org.apache.commons.logging.Log
Fields inherited from interface ubic.gemma.core.loader.util.parser.LineParser
MIN_PARSED_LINES_FOR_UPDATE, PARSE_ALERT_TIME_FREQUENCY_MS
Fields inherited from interface ubic.gemma.core.loader.util.parser.Parser
PARSE_ALERT_FREQUENCY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
containsKey
(K key) abstract T
protected abstract K
abstract Collection
<K> abstract Collection
<T> void
Parse aFile
void
parse
(InputStream is) Parse aInputStream
.void
Parse a file identified by its path.abstract T
parseOneLine
(String line) Handle the parsing of a single line from the input.protected abstract void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ubic.gemma.core.loader.util.parser.Parser
getUniqueResult
-
Field Details
-
COMMENT_MARK
Lines starting with this will be ignored.- See Also:
-
log
protected final org.apache.commons.logging.Log log
-
-
Constructor Details
-
BasicLineMapParser
public BasicLineMapParser()
-
-
Method Details
-
containsKey
-
get
-
getKeySet
-
getResults
- Specified by:
getResults
in interfaceParser<K>
- Returns:
- the results of the parse.
-
parse
Description copied from interface:Parser
Parse aFile
- Specified by:
parse
in interfaceParser<K>
- Parameters:
file
- file- Throws:
IOException
- if there is a problem while manipulating the file
-
parse
Description copied from interface:Parser
Parse aInputStream
.- Specified by:
parse
in interfaceParser<K>
- Parameters:
is
- input stream- Throws:
IOException
- if there is a problem while manipulating the file
-
parse
Description copied from interface:Parser
Parse a file identified by its path.- Specified by:
parse
in interfaceParser<K>
- Parameters:
filename
- Absolute path to the file- Throws:
IOException
- if there is a problem while manipulating the file
-
parseOneLine
Description copied from interface:LineParser
Handle the parsing of a single line from the input.- Specified by:
parseOneLine
in interfaceLineParser<K>
- Parameters:
line
- line to parse- Returns:
- parsed object
-
getKey
-
put
-