pal.datatype
Class TwoStates

java.lang.Object
  extended by pal.datatype.SimpleDataType
      extended by pal.datatype.TwoStates
All Implemented Interfaces:
java.io.Serializable, DataType

public class TwoStates
extends SimpleDataType

implements DataType for two-state data

Version:
$Id: TwoStates.java,v 1.9 2003/03/23 00:04:23 matt Exp $
Author:
Korbinian Strimmer, Alexei Drummond
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface pal.datatype.DataType
DataType.Utils
 
Field Summary
static TwoStates DEFAULT_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
TwoStates()
           
 
Method Summary
protected  char getCharImpl(int state)
           
 java.lang.String getDescription()
          description of data type
 int getNumStates()
          get number of unique states
 int getStateImpl(char c)
          For sub classes to implement main functionality of getState.
 int getTypeID()
          get numerical code describing the data type
protected  boolean isUnknownStateImpl(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_INSTANCE

public static final TwoStates DEFAULT_INSTANCE
Constructor Detail

TwoStates

public TwoStates()
Method Detail

getNumStates

public int getNumStates()
Description copied from interface: DataType
get number of unique states

Returns:
number of unique states

getStateImpl

public int getStateImpl(char c)
Description copied from class: SimpleDataType
For sub classes to implement main functionality of getState. Gaps do not need to be considered

Specified by:
getStateImpl in class SimpleDataType

isUnknownStateImpl

protected final boolean isUnknownStateImpl(int state)
Description copied from class: SimpleDataType
For subclasses to handle, without regard for gaps

Specified by:
isUnknownStateImpl in class SimpleDataType

getCharImpl

protected char getCharImpl(int state)
Specified by:
getCharImpl in class SimpleDataType

getDescription

public java.lang.String getDescription()
Description copied from interface: DataType
description of data type

Returns:
string describing the data type

getTypeID

public int getTypeID()
Description copied from interface: DataType
get numerical code describing the data type

Returns:
numerical code