public abstract class AbstractFeatureCodec<FEATURE_TYPE extends Feature,SOURCE> extends java.lang.Object implements FeatureCodec<FEATURE_TYPE,SOURCE>
Modifier | Constructor and Description |
---|---|
protected |
AbstractFeatureCodec(java.lang.Class<FEATURE_TYPE> myClass) |
Modifier and Type | Method and Description |
---|---|
boolean |
canDecode(java.lang.String path)
This function returns true iff the File potentialInput can be parsed by this
codec.
|
Feature |
decodeLoc(SOURCE source)
Decode a line to obtain just its FeatureLoc for indexing -- contig, start, and stop.
|
java.lang.Class<FEATURE_TYPE> |
getFeatureType()
This function returns the object the codec generates.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, decode, isDone, makeIndexableSourceFromStream, makeSourceFromStream, readHeader
protected AbstractFeatureCodec(java.lang.Class<FEATURE_TYPE> myClass)
public Feature decodeLoc(SOURCE source) throws java.io.IOException
FeatureCodec
decodeLoc
in interface FeatureCodec<FEATURE_TYPE extends Feature,SOURCE>
source
- the input stream from which to decode the next recordjava.io.IOException
public java.lang.Class<FEATURE_TYPE> getFeatureType()
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
getFeatureType
in interface FeatureCodec<FEATURE_TYPE extends Feature,SOURCE>
public boolean canDecode(java.lang.String path)
FeatureCodec
This function returns true iff the File potentialInput can be parsed by this codec.
There is an assumption that there's never a situation where two different Codecs return true for the same file. If this occurs, the recommendation would be to error out.
Note this function must never throw an error. All errors should be trapped and false returned.canDecode
in interface FeatureCodec<FEATURE_TYPE extends Feature,SOURCE>
path
- the file to test for parsability with this codec