pal.datatype
Class IUPACNucleotides

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

public class IUPACNucleotides
extends java.lang.Object
implements DataType

implements DataType for nucleotides with ambiguous characters

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
IUPACNucleotides()
           
 
Method Summary
 char getChar(int state)
          get character corresponding to a given state
 java.lang.String getDescription()
          description of data type
 int getNumSimpleStates()
          returns the number of true non-ambiguous states.
 int getNumStates()
          Get number of states.
 int[] getSimpleStates(int state)
          returns an array containing the non-ambiguous states that this state represents.
 int getState(char c)
          get state corresponding to a character
 int getTypeID()
          get numerical code describing the data type
 boolean isAmbiguousState(int state)
          returns true if this state is an ambiguous state.
 boolean isUnknownChar(char c)
           
 boolean isUnknownState(int state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IUPACNucleotides

public IUPACNucleotides()
Method Detail

getNumStates

public int getNumStates()
Get number of states.
Specified by:
getNumStates in interface DataType
Following copied from interface: pal.datatype.DataType
Returns:
number of unique states

isUnknownState

public boolean isUnknownState(int state)
Specified by:
isUnknownState in interface DataType
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)

getNumSimpleStates

public int getNumSimpleStates()
returns the number of true non-ambiguous states.
Specified by:
getNumSimpleStates in interface DataType
Following copied from interface: pal.datatype.DataType
Returns:
number of unique states

getState

public final int getState(char c)
Description copied from interface: DataType
get state corresponding to a character
Specified by:
getState in interface DataType
Following copied from interface: pal.datatype.DataType
Parameters:
c - character
Returns:
state

getChar

public char getChar(int state)
Description copied from interface: DataType
get character corresponding to a given state
Specified by:
getChar in interface DataType
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
Specified by:
getDescription in interface DataType
Following copied from interface: pal.datatype.DataType
Returns:
string describing the data type

getTypeID

public int getTypeID()
Description copied from interface: DataType
get numerical code describing the data type
Specified by:
getTypeID in interface DataType
Following copied from interface: pal.datatype.DataType
Returns:
numerical code

isAmbiguousState

public boolean isAmbiguousState(int state)
returns true if this state is an ambiguous state.
Specified by:
isAmbiguousState in interface DataType

getSimpleStates

public int[] getSimpleStates(int state)
returns an array containing the non-ambiguous states that this state represents.
Specified by:
getSimpleStates in interface DataType

isUnknownChar

public boolean isUnknownChar(char c)
Specified by:
isUnknownChar in interface DataType
Returns:
true if this state is a gap