pal.datatype
Class TwoStates

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

public class TwoStates
extends SimpleDataType

implements DataType for two-state data

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
TwoStates()
           
 
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 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

TwoStates

public TwoStates()
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

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

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)

getChar

public char getChar(int state)
Description copied from interface: DataType
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

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