Package pal.datatype
Class NumericDataType
- java.lang.Object
-
- pal.datatype.SimpleDataType
-
- pal.datatype.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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface pal.datatype.DataType
DataType.Utils
-
-
Field Summary
Fields Modifier and Type Field Description static DataTypeDEFAULT_INSTANCE-
Fields inherited from interface pal.datatype.DataType
AMINO_ACID_DESCRIPTION, AMINOACIDS, CODON_DESCRIPTION, CODONS, GAP_BALANCED, GAP_BALANCED_DESCRIPTION, IUPAC_NUCELOTIDES_DESCRIPTION, IUPACNUCLEOTIDES, NUCLEOTIDE_DESCRIPTION, NUCLEOTIDES, NUMERIC, PRIMARY_SUGGESTED_GAP_CHARACTER, SUGGESTED_GAP_CHARACTERS, SUGGESTED_GAP_STATE, SUGGESTED_UNKNOWN_STATE, TWO_STATE_DESCRIPTION, TWOSTATES, UNKNOWN, UNKNOWN_CHARACTER, UNKNOWN_TLA
-
-
Constructor Summary
Constructors Constructor Description NumericDataType()NumericDataType(int numberOfStates)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected chargetCharImpl(int state)Get character corresponding to a given statejava.lang.StringgetDescription()String describing the data typechargetNumericCharFromNumericIndex(int index)Returns a unique ascii character for any given numeric sizeintgetNumericIndexFromNumericChar(char c)Returns numeric index (size) from a unique ascii characterintgetNumStates()get number of unique statesprotected intgetStateImpl(char c)get state corresponding to a characterintgetTypeID()Get numerical code describing the data typeprotected booleanisUnknownStateImpl(int state)For subclasses to handle, without regard for gaps-
Methods inherited from class pal.datatype.SimpleDataType
getAmbiguousVersion, getChar, getPreferredChar, getPreferredCharImpl, getRecommendedGapState, getRecommendedUnknownState, getState, hasGap, isAmbiguous, isGapChar, isGapState, isUnknownChar, isUnknownState, toString
-
-
-
-
Field Detail
-
DEFAULT_INSTANCE
public static final DataType DEFAULT_INSTANCE
-
-
Method Detail
-
getNumStates
public int getNumStates()
Description copied from interface:DataTypeget number of unique states- Returns:
- number of unique states
-
isUnknownStateImpl
protected boolean isUnknownStateImpl(int state)
Description copied from class:SimpleDataTypeFor subclasses to handle, without regard for gaps- Specified by:
isUnknownStateImplin classSimpleDataType- Returns:
- true if this state is an unknown state
-
getStateImpl
protected int getStateImpl(char c)
get state corresponding to a character- Specified by:
getStateImplin classSimpleDataType- Parameters:
c- character- Returns:
- state
-
getCharImpl
protected char getCharImpl(int state)
Get character corresponding to a given state- Specified by:
getCharImplin classSimpleDataType
-
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
-
-