public abstract class SimpleDataType extends java.lang.Object implements DataType
DataType.Utils
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 and Description |
---|
SimpleDataType() |
Modifier and Type | Method and Description |
---|---|
AmbiguousDataType |
getAmbiguousVersion() |
char |
getChar(int state)
Handles gap state and then passes on to getStateImpl
|
protected abstract char |
getCharImpl(int state) |
char |
getPreferredChar(char c)
Automatically handles Gaps for sub classes
|
protected char |
getPreferredCharImpl(char c)
Can be overidden by subclasses.
|
int |
getRecommendedGapState() |
int |
getRecommendedUnknownState() |
int |
getState(char c)
Handles gap char and then passes on to getStateImpl
|
protected abstract int |
getStateImpl(char c)
For sub classes to implement main functionality of getState.
|
boolean |
hasGap() |
boolean |
isAmbiguous() |
boolean |
isGapChar(char c) |
boolean |
isGapState(int state) |
boolean |
isUnknownChar(char c) |
boolean |
isUnknownState(int state)
Checks if state is a gap state (then returns true), otherwise passes on
to isUnknownStateImpl
|
protected abstract boolean |
isUnknownStateImpl(int state)
For subclasses to handle, without regard for gaps
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDescription, getNumStates, getTypeID
public final int getState(char c)
public final char getChar(int state)
protected abstract int getStateImpl(char c)
protected abstract char getCharImpl(int state)
public final char getPreferredChar(char c)
getPreferredChar
in interface DataType
protected char getPreferredCharImpl(char c)
public final boolean isUnknownChar(char c)
isUnknownChar
in interface DataType
public final boolean isUnknownState(int state)
isUnknownState
in interface DataType
protected abstract boolean isUnknownStateImpl(int state)
public java.lang.String toString()
toString
in class java.lang.Object
public int getRecommendedUnknownState()
getRecommendedUnknownState
in interface DataType
public boolean isAmbiguous()
isAmbiguous
in interface DataType
public AmbiguousDataType getAmbiguousVersion()
getAmbiguousVersion
in interface DataType
public final boolean isGapChar(char c)
public final boolean isGapState(int state)
isGapState
in interface DataType
public final int getRecommendedGapState()
getRecommendedGapState
in interface DataType