htsjdk.variant.variantcontext.writer
Class BCF2FieldEncoder.GenericInts

java.lang.Object
  extended by htsjdk.variant.variantcontext.writer.BCF2FieldEncoder
      extended by htsjdk.variant.variantcontext.writer.BCF2FieldEncoder.GenericInts
Enclosing class:
BCF2FieldEncoder

public static class BCF2FieldEncoder.GenericInts
extends BCF2FieldEncoder


Nested Class Summary
 
Nested classes/interfaces inherited from class htsjdk.variant.variantcontext.writer.BCF2FieldEncoder
BCF2FieldEncoder.AtomicInt, BCF2FieldEncoder.Flag, BCF2FieldEncoder.Float, BCF2FieldEncoder.GenericInts, BCF2FieldEncoder.IntArray, BCF2FieldEncoder.StringOrCharacter
 
Constructor Summary
BCF2FieldEncoder.GenericInts(VCFCompoundHeaderLine headerLine, java.util.Map<java.lang.String,java.lang.Integer> dict)
           
 
Method Summary
 void encodeValue(BCF2Encoder encoder, java.lang.Object value, BCF2Type type, int minValues)
          Key abstract method that should encode a value of the given type into the encoder.
 BCF2Type getDynamicType(java.lang.Object value)
           
 
Methods inherited from class htsjdk.variant.variantcontext.writer.BCF2FieldEncoder
getCountType, getField, getStaticType, getType, hasConstantNumElements, hasContextDeterminedNumElements, hasValueDeterminedNumElements, isDynamicallyTyped, isStaticallyTyped, numElements, numElements, numElements, numElements, numElementsFromValue, toString, writeFieldKey
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BCF2FieldEncoder.GenericInts

public BCF2FieldEncoder.GenericInts(VCFCompoundHeaderLine headerLine,
                                    java.util.Map<java.lang.String,java.lang.Integer> dict)
Method Detail

getDynamicType

public BCF2Type getDynamicType(java.lang.Object value)
Overrides:
getDynamicType in class BCF2FieldEncoder

encodeValue

public void encodeValue(BCF2Encoder encoder,
                        java.lang.Object value,
                        BCF2Type type,
                        int minValues)
                 throws java.io.IOException
Description copied from class: BCF2FieldEncoder
Key abstract method that should encode a value of the given type into the encoder. Value will be of a type appropriate to the underlying encoder. If the genotype field is represented as an int[], this will be value, and the encoder needs to handle encoding all of the values in the int[]. The argument should be used, not the getType() method in the superclass as an outer loop might have decided a more general type (int16) to use, even through this encoder could have been done with int8. If minValues > 0, then encodeValue must write in at least minValues items from value. If value is atomic, this means that minValues - 1 MISSING values should be added to the encoder. If minValues is a collection type (int[]) then minValues - values.length should be added. This argument is intended to handle padding of values in genotype fields.

Specified by:
encodeValue in class BCF2FieldEncoder
Throws:
java.io.IOException