public abstract class BCF2FieldEncoder
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BCF2FieldEncoder.AtomicInt
Specialized int encoder for atomic (non-list) integers
|
static class |
BCF2FieldEncoder.Flag |
static class |
BCF2FieldEncoder.Float |
static class |
BCF2FieldEncoder.GenericInts |
static class |
BCF2FieldEncoder.IntArray |
static class |
BCF2FieldEncoder.StringOrCharacter |
| Modifier and Type | Method and Description |
|---|---|
abstract 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.
|
protected VCFHeaderLineCount |
getCountType() |
BCF2Type |
getDynamicType(java.lang.Object value) |
java.lang.String |
getField() |
BCF2Type |
getStaticType() |
BCF2Type |
getType(java.lang.Object value)
Get the BCF2 type for this field, either from the static type of the
field itself or by inspecting the value itself.
|
boolean |
hasConstantNumElements()
True if this field has a constant, fixed number of elements (such as 1 for an atomic integer)
|
boolean |
hasContextDeterminedNumElements()
True if this field has a non-fixed number of elements that depends only on the properties
of the current VariantContext, such as one value per Allele or per genotype configuration.
|
boolean |
hasValueDeterminedNumElements()
True if the only way to determine how many elements this field contains is by
inspecting the actual value directly, such as when the number of elements
is a variable length list per site or per genotype.
|
boolean |
isDynamicallyTyped()
Is the BCF2 type of this field static, or does it have to be determine from
the actual field value itself?
|
boolean |
isStaticallyTyped()
Is the BCF2 type of this field static, or does it have to be determine from
the actual field value itself?
|
int |
numElements()
Get the number of elements, assuming this field has a constant number of elements.
|
int |
numElements(java.lang.Object value)
Get the number of elements by looking at the actual value provided
|
int |
numElements(VariantContext vc)
Get the number of elements, assuming this field has context-determined number of elements.
|
int |
numElements(VariantContext vc,
java.lang.Object value)
A convenience access for the number of elements, returning
the number of encoded elements, either from the fixed number
it has, from the VC, or from the value itself.
|
protected int |
numElementsFromValue(java.lang.Object value)
Given a value, return the number of elements we will encode for it.
|
java.lang.String |
toString() |
void |
writeFieldKey(BCF2Encoder encoder)
Write the field key (dictionary offset and type) into the BCF2Encoder stream
|
public final java.lang.String getField()
public final void writeFieldKey(BCF2Encoder encoder) throws java.io.IOException
encoder - where we write our dictionary offsetjava.io.IOExceptionpublic java.lang.String toString()
toString in class java.lang.Objectprotected final VCFHeaderLineCount getCountType()
public boolean hasConstantNumElements()
public boolean hasValueDeterminedNumElements()
public boolean hasContextDeterminedNumElements()
public int numElements()
public int numElements(java.lang.Object value)
public int numElements(VariantContext vc)
public final int numElements(VariantContext vc, java.lang.Object value)
vc - value - protected int numElementsFromValue(java.lang.Object value)
value - public final boolean isStaticallyTyped()
public final boolean isDynamicallyTyped()
public final BCF2Type getType(java.lang.Object value)
public final BCF2Type getStaticType()
public BCF2Type getDynamicType(java.lang.Object value)
public abstract void encodeValue(BCF2Encoder encoder, java.lang.Object value, BCF2Type type, int minValues) throws java.io.IOException
encoder - value - type - minValues - java.io.IOException