Package htsjdk.samtools.cram.encoding
Class EncodingFactory
java.lang.Object
htsjdk.samtools.cram.encoding.EncodingFactory
A helper class to choose and instantiate an appropriate
CRAMEncoding
given a DataSeriesType
and
an EncodingDescriptor
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> CRAMEncoding<T>
createCRAMEncoding
(DataSeriesType valueType, EncodingDescriptor encodingDescriptor) Use the data series value type and EncodingDescriptor to instantiate a corresponding CRAMEncoding of the correct (generic) type.static <T> CRAMEncoding<T>
createCRAMEncoding
(DataSeriesType valueType, EncodingID encodingID, byte[] params) Create an encoding of the correct type for the data series type and encoding id and params.
-
Constructor Details
-
EncodingFactory
public EncodingFactory()
-
-
Method Details
-
createCRAMEncoding
public static <T> CRAMEncoding<T> createCRAMEncoding(DataSeriesType valueType, EncodingDescriptor encodingDescriptor) Use the data series value type and EncodingDescriptor to instantiate a corresponding CRAMEncoding of the correct (generic) type.- Type Parameters:
T
-- Parameters:
valueType
-encodingDescriptor
-- Returns:
-
createCRAMEncoding
public static <T> CRAMEncoding<T> createCRAMEncoding(DataSeriesType valueType, EncodingID encodingID, byte[] params) Create an encoding of the correct type for the data series type and encoding id and params.- Type Parameters:
T
- encoding object type, like Integer or String.- Parameters:
valueType
- data type of the values to be produced/consumed by the encodingencodingID
- encoding id used for data serializationparams
- encoding initialization values- Returns:
- a new encoding with the requested parameters
-