public abstract class AbstractFeatureReader<T extends Feature,SOURCE> extends java.lang.Object implements FeatureReader<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractFeatureReader.ComponentMethods |
| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<java.lang.String> |
BLOCK_COMPRESSED_EXTENSIONS
Deprecated.
use
IOUtil.BLOCK_COMPRESSED_EXTENSIONS instead. |
protected FeatureCodec<T,SOURCE> |
codec |
protected FeatureCodecHeader |
header |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractFeatureReader(java.lang.String path,
FeatureCodec<T,SOURCE> codec) |
protected |
AbstractFeatureReader(java.lang.String path,
FeatureCodec<T,SOURCE> codec,
java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> wrapper,
java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> indexWrapper) |
| Modifier and Type | Method and Description |
|---|---|
static <FEATURE extends Feature,SOURCE> |
getFeatureReader(java.lang.String featureFile,
FeatureCodec<FEATURE,SOURCE> codec)
Calls
getFeatureReader(String, FeatureCodec, boolean) with requireIndex = true |
static <FEATURE extends Feature,SOURCE> |
getFeatureReader(java.lang.String featureResource,
FeatureCodec<FEATURE,SOURCE> codec,
boolean requireIndex)
getFeatureReader(String, String, FeatureCodec, boolean, Function, Function) with null for indexResource, wrapper, and indexWrapper |
static <FEATURE extends Feature,SOURCE> |
getFeatureReader(java.lang.String featureResource,
FeatureCodec<FEATURE,SOURCE> codec,
Index index)
Return a reader with a supplied index.
|
static <FEATURE extends Feature,SOURCE> |
getFeatureReader(java.lang.String featureResource,
java.lang.String indexResource,
FeatureCodec<FEATURE,SOURCE> codec,
boolean requireIndex)
getFeatureReader(String, String, FeatureCodec, boolean, Function, Function) with null for wrapper, and indexWrapper |
static <FEATURE extends Feature,SOURCE> |
getFeatureReader(java.lang.String featureResource,
java.lang.String indexResource,
FeatureCodec<FEATURE,SOURCE> codec,
boolean requireIndex,
java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> wrapper,
java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> indexWrapper) |
java.lang.Object |
getHeader()
get the header
|
static boolean |
hasBlockCompressedExtension(java.io.File file)
Deprecated.
|
static boolean |
hasBlockCompressedExtension(java.lang.String fileName)
Deprecated.
|
static boolean |
hasBlockCompressedExtension(java.net.URI uri)
Deprecated.
|
boolean |
hasIndex()
Whether the reader has an index or not
Default implementation returns false
|
boolean |
isQueryable() |
static boolean |
isTabix(java.lang.String resourcePath,
java.lang.String indexPath) |
static void |
setComponentMethods(AbstractFeatureReader.ComponentMethods methods) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, getSequenceNames, iterator, query, queryprotected final FeatureCodec<T extends Feature,SOURCE> codec
protected FeatureCodecHeader header
@Deprecated public static final java.util.Set<java.lang.String> BLOCK_COMPRESSED_EXTENSIONS
IOUtil.BLOCK_COMPRESSED_EXTENSIONS instead.protected AbstractFeatureReader(java.lang.String path,
FeatureCodec<T,SOURCE> codec)
protected AbstractFeatureReader(java.lang.String path,
FeatureCodec<T,SOURCE> codec,
java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> wrapper,
java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> indexWrapper)
public static <FEATURE extends Feature,SOURCE> AbstractFeatureReader<FEATURE,SOURCE> getFeatureReader(java.lang.String featureFile, FeatureCodec<FEATURE,SOURCE> codec) throws TribbleException
getFeatureReader(String, FeatureCodec, boolean) with requireIndex = trueTribbleExceptionpublic static <FEATURE extends Feature,SOURCE> AbstractFeatureReader<FEATURE,SOURCE> getFeatureReader(java.lang.String featureResource, FeatureCodec<FEATURE,SOURCE> codec, boolean requireIndex) throws TribbleException
getFeatureReader(String, String, FeatureCodec, boolean, Function, Function) with null for indexResource, wrapper, and indexWrapperTribbleExceptionpublic static <FEATURE extends Feature,SOURCE> AbstractFeatureReader<FEATURE,SOURCE> getFeatureReader(java.lang.String featureResource, java.lang.String indexResource, FeatureCodec<FEATURE,SOURCE> codec, boolean requireIndex) throws TribbleException
getFeatureReader(String, String, FeatureCodec, boolean, Function, Function) with null for wrapper, and indexWrapperTribbleExceptionpublic static <FEATURE extends Feature,SOURCE> AbstractFeatureReader<FEATURE,SOURCE> getFeatureReader(java.lang.String featureResource, java.lang.String indexResource, FeatureCodec<FEATURE,SOURCE> codec, boolean requireIndex, java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> wrapper, java.util.function.Function<java.nio.channels.SeekableByteChannel,java.nio.channels.SeekableByteChannel> indexWrapper) throws TribbleException
featureResource - the feature file to create fromindexResource - the index for the feature file. If null, will auto-generate (if necessary)codec - the codec to use to decode the individual featuresrequireIndex - whether an index is required for this filewrapper - a wrapper to apply to the byte stream from the featureResource allowing injecting features
like caching and prefetching of the stream, may be null, will only be applied if featureResource
is a uri representing a PathindexWrapper - a wrapper to apply to the byte stream from the indexResource, may be null, will only be
applied if indexResource is a uri representing a PathTribbleExceptionpublic static <FEATURE extends Feature,SOURCE> AbstractFeatureReader<FEATURE,SOURCE> getFeatureReader(java.lang.String featureResource, FeatureCodec<FEATURE,SOURCE> codec, Index index) throws TribbleException
featureResource - the path to the source file containing the featurescodec - used to decode the featuresindex - index of featureResourceTribbleExceptionpublic boolean hasIndex()
public boolean isQueryable()
isQueryable in interface FeatureReader<T extends Feature>public static void setComponentMethods(AbstractFeatureReader.ComponentMethods methods)
@Deprecated public static boolean hasBlockCompressedExtension(java.lang.String fileName)
IOUtil.hasBlockCompressedExtension(String).@Deprecated public static boolean hasBlockCompressedExtension(java.io.File file)
IOUtil.hasBlockCompressedExtension(File).@Deprecated public static boolean hasBlockCompressedExtension(java.net.URI uri)
IOUtil.hasBlockCompressedExtension(URI).public java.lang.Object getHeader()
getHeader in interface FeatureReader<T extends Feature>public static boolean isTabix(java.lang.String resourcePath,
java.lang.String indexPath)
throws java.io.IOException
java.io.IOException