Package pal.datatype

Class NumericDataType

  • All Implemented Interfaces:
    java.io.Serializable, DataType

    public class NumericDataType
    extends SimpleDataType
    This datatype stores numeric values. These can be any 2 byte integer between 0-65536. This can be used for SSR alleles or indel sizes.
    Version:
    $Id:
    Author:
    Ed Buckler
    See Also:
    Serialized Form
    • Field Detail

      • DEFAULT_INSTANCE

        public static final DataType DEFAULT_INSTANCE
    • Constructor Detail

      • NumericDataType

        public NumericDataType()
      • NumericDataType

        public NumericDataType​(int numberOfStates)
    • Method Detail

      • getNumStates

        public int getNumStates()
        Description copied from interface: DataType
        get number of unique states
        Returns:
        number of unique states
      • isUnknownStateImpl

        protected boolean isUnknownStateImpl​(int state)
        Description copied from class: SimpleDataType
        For subclasses to handle, without regard for gaps
        Specified by:
        isUnknownStateImpl in class SimpleDataType
        Returns:
        true if this state is an unknown state
      • getStateImpl

        protected int getStateImpl​(char c)
        get state corresponding to a character
        Specified by:
        getStateImpl in class SimpleDataType
        Parameters:
        c - character
        Returns:
        state
      • getCharImpl

        protected char getCharImpl​(int state)
        Get character corresponding to a given state
        Specified by:
        getCharImpl in class SimpleDataType
      • getNumericCharFromNumericIndex

        public final char getNumericCharFromNumericIndex​(int index)
        Returns a unique ascii character for any given numeric size
      • getNumericIndexFromNumericChar

        public final int getNumericIndexFromNumericChar​(char c)
        Returns numeric index (size) from a unique ascii character
      • getDescription

        public java.lang.String getDescription()
        String describing the data type
        Returns:
        string describing the data type
      • getTypeID

        public int getTypeID()
        Get numerical code describing the data type
        Returns:
        numerical code