pal.datatype
Class NumericDataType

java.lang.Object
  |
  +--pal.datatype.SimpleDataType
        |
        +--pal.datatype.NumericDataType
All Implemented Interfaces:
DataType, java.io.Serializable

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.

See Also:
Serialized Form

Fields inherited from interface pal.datatype.DataType
AMINO_ACID_DESCRIPTION, AMINOACIDS, CODON_DESCRIPTION, CODONS, GENERALIZED_CODONS_DESCRIPTION, GENERALIZEDCODONS, IUPAC_NUCELOTIDES_DESCRIPTION, IUPACNUCLEOTIDES, NUCLEOTIDE_DESCRIPTION, NUCLEOTIDES, TWO_STATE_DESCRIPTION, TWOSTATES, UNKNOWN_CHARACTER
 
Constructor Summary
NumericDataType()
           
 
Method Summary
 char getChar(int state)
          Get character corresponding to a given state
 java.lang.String getDescription()
          String describing the data type
 char getNumericCharFromNumericIndex(int index)
          Returns a unique ascii character for any given numeric size
 int getNumericIndexFromNumericChar(char c)
          Returns numeric index (size) from a unique ascii character
 int getNumStates()
          get number of unique states
 int getState(char c)
          get state corresponding to a character
 int getTypeID()
          Get numerical code describing the data type
 boolean isUnknownState(int state)
           
 
Methods inherited from class pal.datatype.SimpleDataType
getNumSimpleStates, getSimpleStates, isAmbiguousState, isGapChar, isUnknownChar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NumericDataType

public NumericDataType()
Method Detail

getNumStates

public int getNumStates()
Description copied from interface: DataType
get number of unique states
Following copied from interface: pal.datatype.DataType
Returns:
number of unique states

isUnknownState

public boolean isUnknownState(int state)
Overrides:
isUnknownState in class SimpleDataType
Returns:
true if this state is an unknown state

getState

public int getState(char c)
get state corresponding to a character
Parameters:
c - character
Returns:
state

getChar

public char getChar(int state)
Get character corresponding to a given state
Following copied from interface: pal.datatype.DataType
Parameters:
state - state return corresponding character

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
Following copied from interface: pal.datatype.DataType
Returns:
string describing the data type

getTypeID

public int getTypeID()
Get numerical code describing the data type
Following copied from interface: pal.datatype.DataType
Returns:
numerical code