Package htsjdk.variant.bcf2
Enum Class BCF2Type
- All Implemented Interfaces:
Serializable
,Comparable<BCF2Type>
,Constable
BCF2 types and associated information
- Since:
- 05/12
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionint
getID()
The ID according to the BCF2 specificationint
The bytes (encoded as an int) that are used to represent a missing value for this type in BCF2Return the java object (aka null) that is used to represent a missing value for this type in Javaint
How many bytes are used to represent this type on disk?boolean
boolean
int
read
(InputStream in) Read a value from in stream of this BCF2 type as an int [32 bit] collection of bits For intX and char values this is just the int / byte value of the underlying data represented as a 32 bit int For a char the result must be converted to a char by (char)(byte)(0x0F & value) For doubles it's necessary to convert subsequently this value to a double via Double.bitsToDouble()static BCF2Type
Returns the enum constant of this class with the specified name.static BCF2Type[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.final boolean
withinRange
(long v) Can we encode value v in this type, according to its declared range.void
write
(int value, OutputStream out)
-
Enum Constant Details
-
MISSING
-
INT8
-
INT16
-
INT32
-
FLOAT
-
CHAR
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getSizeInBytes
public int getSizeInBytes()How many bytes are used to represent this type on disk?- Returns:
-
getID
public int getID()The ID according to the BCF2 specification- Returns:
-
withinRange
public final boolean withinRange(long v) Can we encode value v in this type, according to its declared range. Only makes sense for integer values- Parameters:
v
-- Returns:
-
getMissingJavaValue
Return the java object (aka null) that is used to represent a missing value for this type in Java- Returns:
-
getMissingBytes
public int getMissingBytes()The bytes (encoded as an int) that are used to represent a missing value for this type in BCF2- Returns:
-
isMissingType
public boolean isMissingType()- Returns:
- true if this BCF2Type corresponds to the magic "MISSING" type (0x00)
-
isIntegerType
public boolean isIntegerType() -
read
Read a value from in stream of this BCF2 type as an int [32 bit] collection of bits For intX and char values this is just the int / byte value of the underlying data represented as a 32 bit int For a char the result must be converted to a char by (char)(byte)(0x0F & value) For doubles it's necessary to convert subsequently this value to a double via Double.bitsToDouble()- Parameters:
in
-- Returns:
- Throws:
IOException
-
write
- Throws:
IOException
-