pal.datatype
Class SimpleDataType

java.lang.Object
  |
  +--pal.datatype.SimpleDataType
All Implemented Interfaces:
DataType, java.io.Serializable
Direct Known Subclasses:
AminoAcids, Codons, GeneralizedCodons, Nucleotides, NumericDataType, StateRemover, TwoStates

public abstract class SimpleDataType
extends java.lang.Object
implements DataType

interface for sequence data types

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
SimpleDataType()
           
 
Method Summary
 int getNumSimpleStates()
          get number of unique non-ambiguous states
 int[] getSimpleStates(int state)
          returns an array containing the non-ambiguous states that this state represents.
 boolean isAmbiguousState(int state)
          returns true if this state is an ambiguous state.
 boolean isGapChar(char c)
           
 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
 
Methods inherited from interface pal.datatype.DataType
getChar, getDescription, getNumStates, getState, getTypeID
 

Constructor Detail

SimpleDataType

public SimpleDataType()
Method Detail

isAmbiguousState

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

getSimpleStates

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

getNumSimpleStates

public final int getNumSimpleStates()
get number of unique non-ambiguous states
Specified by:
getNumSimpleStates in interface DataType
Returns:
number of unique states

isGapChar

public boolean isGapChar(char c)
Returns:
true if this state is a gap

isUnknownChar

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

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)