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
-
Method Summary
Modifier and TypeMethodDescriptionstatic HtsCodecRegistry
Create a mutable registry for private use.Get theHaploidReferenceResolver
for this registry.Get theReadsResolver
for this registry.Get theVariantsResolver
for 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. TheHtsDefaultRegistry
is 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 theHaploidReferenceResolver
for this registry.- Returns:
- the
HaploidReferenceResolver
for this registry
-
getReadsResolver
Get theReadsResolver
for this registry.- Returns:
- the
ReadsResolver
for this registry
-
getVariantsResolver
Get theVariantsResolver
for this registry.- Returns:
- the
VariantsResolver
for this registry
-