Enum Class BCF2Type

java.lang.Object
java.lang.Enum<BCF2Type>
htsjdk.variant.bcf2.BCF2Type
All Implemented Interfaces:
Serializable, Comparable<BCF2Type>, Constable

public enum BCF2Type extends Enum<BCF2Type>
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
    Enum Constant
    Description
     
     
     
     
     
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The ID according to the BCF2 specification
    int
    The bytes (encoded as an int) that are used to represent a missing value for this type in BCF2
    Return the java object (aka null) that is used to represent a missing value for this type in Java
    int
    How many bytes are used to represent this type on disk?
    boolean
     
    boolean
     
    int
    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[]
    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)
     

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • MISSING

      public static final BCF2Type MISSING
    • INT8

      public static final BCF2Type INT8
    • INT16

      public static final BCF2Type INT16
    • INT32

      public static final BCF2Type INT32
    • FLOAT

      public static final BCF2Type FLOAT
    • CHAR

      public static final BCF2Type CHAR
  • Method Details

    • values

      public static BCF2Type[] 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

      public static BCF2Type valueOf(String name)
      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 name
      NullPointerException - 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

      public Object 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

      public int read(InputStream in) throws IOException
      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

      public void write(int value, OutputStream out) throws IOException
      Throws:
      IOException