pal.datatype
Class Codons
java.lang.Object
|
+--pal.datatype.SimpleDataType
|
+--pal.datatype.Codons
- All Implemented Interfaces:
- DataType, java.io.Serializable
- public class Codons
- extends SimpleDataType
implements DataType for all Codons (including terminators).
Accepts the same characters as those given by
CodonTranslator.getUniqueCharacter(),
states here are index for CodonTranslator.getCodonIndex()
That is. Codons.getCharacter(CondonTranslator.getIndex("codon")) ==
CondonTranslator.getUniqueCharacter("codon")
- 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 |
Method Summary |
char |
getChar(int state)
Get character corresponding to a given state |
java.lang.String |
getDescription()
description of data type |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Codons
public Codons()
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
getState
public int getState(char c)
- Description copied from interface:
DataType
- get state corresponding to a character
- Following copied from interface:
pal.datatype.DataType
- 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
getDescription
public java.lang.String getDescription()
- Description copied from interface:
DataType
- description of data type
- Following copied from interface:
pal.datatype.DataType
- Returns:
- string describing the data type
isUnknownState
public boolean isUnknownState(int state)
- Overrides:
isUnknownState
in class SimpleDataType
- Following copied from interface:
pal.datatype.DataType
- Returns:
- true if this state is an unknown state
(the same as check if a state is >= the number of states... but neater)
getTypeID
public int getTypeID()
- Description copied from interface:
DataType
- get numerical code describing the data type
- Following copied from interface:
pal.datatype.DataType
- Returns:
- numerical code