Package htsjdk.beta.plugin.registry
Class HtsCodecRegistry
java.lang.Object
htsjdk.beta.plugin.registry.HtsCodecRegistry
A registry for tracking
HtsCodec instances.
Registries are populated with HtsCodec objects that are either discovered
and registered statically in the HtsDefaultRegistry, or manually registered in a private
registry (see createPrivateRegistry()) via the registerCodec(HtsCodec)
method.
The global static HtsDefaultRegistry is immutable. A private, mutable registry for registering
custom codecs can be created with createPrivateRegistry().
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic HtsCodecRegistryCreate a mutable registry for private use.Get theHaploidReferenceResolverfor this registry.Get theReadsResolverfor this registry.Get theVariantsResolverfor this registry.HtsCodec<?, ?> registerCodec(HtsCodec<?, ?> codec) Add a codec to the registry.
-
Constructor Details
-
HtsCodecRegistry
protected HtsCodecRegistry()Create a registry. Protected to prevent use outside of the registry package. To create a private registry from outside the registry package, usecreatePrivateRegistry().
-
-
Method Details
-
registerCodec
Add a codec to the registry. If a codec that supports the same (format, version) (determined byHtsCodec.getFileFormat()andHtsCodec.getVersion()methods) is already registered, the new registry is updated to contain the new codec, and the previously registered codec is returned.- Parameters:
codec- the codec to be added- Returns:
- a previously registered codec with the same (format, version), or null if no codec was previously registered
-
createPrivateRegistry
Create a mutable registry for private use. TheHtsDefaultRegistryis immutable, but a private registry can be populated with, and used to resolve against, custom codecs. A private registry is initially populated with all codecs that are registered in theHtsDefaultRegistry. Custom codecs can be then be installed into the private registry usingregisterCodec(HtsCodec).- Returns:
- a mutable registry instance for private use
-
getHaploidReferenceResolver
Get theHaploidReferenceResolverfor this registry.- Returns:
- the
HaploidReferenceResolverfor this registry
-
getReadsResolver
Get theReadsResolverfor this registry.- Returns:
- the
ReadsResolverfor this registry
-
getVariantsResolver
Get theVariantsResolverfor this registry.- Returns:
- the
VariantsResolverfor this registry
-