Package htsjdk.tribble
Class AbstractFeatureCodec<FEATURE_TYPE extends Feature,SOURCE>
java.lang.Object
htsjdk.tribble.AbstractFeatureCodec<FEATURE_TYPE,SOURCE>
- All Implemented Interfaces:
FeatureCodec<FEATURE_TYPE,
SOURCE>
- Direct Known Subclasses:
AsciiFeatureCodec
,Gff3Codec
public abstract class AbstractFeatureCodec<FEATURE_TYPE extends Feature,SOURCE>
extends Object
implements FeatureCodec<FEATURE_TYPE,SOURCE>
Simple basic class providing much of the basic functionality of codecs
Every concrete subclass must implement only one codec
is allowed to identify itself as being able to decode any given file.
FeatureCodec.canDecode(String)
to indicate whether it can decode the file.
Note that that method is the only way that the right codec for a file is identified and that -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDecode a line to obtain just its FeatureLoc for indexing -- contig, start, and stop.This function returns the object the codec generates.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface htsjdk.tribble.FeatureCodec
canDecode, close, decode, getPathToDataFile, getTabixFormat, isDone, makeIndexableSourceFromStream, makeSourceFromStream, readHeader
-
Constructor Details
-
AbstractFeatureCodec
-
-
Method Details
-
decodeLoc
Description copied from interface:FeatureCodec
Decode a line to obtain just its FeatureLoc for indexing -- contig, start, and stop.- Specified by:
decodeLoc
in interfaceFeatureCodec<FEATURE_TYPE extends Feature,
SOURCE> - Parameters:
source
- the input stream from which to decode the next record- Returns:
- Return the FeatureLoc encoded by the line, or null if the line does not represent a feature (e.g. is a comment)
- Throws:
IOException
-
getFeatureType
Description copied from interface:FeatureCodec
This function returns the object the codec generates. This is allowed to be Feature in the case where conditionally different types are generated. Be as specific as you can though.
This function is used by reflections based tools, so we can know the underlying type
- Specified by:
getFeatureType
in interfaceFeatureCodec<FEATURE_TYPE extends Feature,
SOURCE> - Returns:
- the feature type this codec generates.
-