public abstract class SimpleDataType extends java.lang.Object implements DataType
DataType.UtilsAMINO_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, waitgetDescription, getNumStates, getTypeIDpublic 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 DataTypeprotected char getPreferredCharImpl(char c)
public final boolean isUnknownChar(char c)
isUnknownChar in interface DataTypepublic final boolean isUnknownState(int state)
isUnknownState in interface DataTypeprotected abstract boolean isUnknownStateImpl(int state)
public java.lang.String toString()
toString in class java.lang.Objectpublic int getRecommendedUnknownState()
getRecommendedUnknownState in interface DataTypepublic boolean isAmbiguous()
isAmbiguous in interface DataTypepublic AmbiguousDataType getAmbiguousVersion()
getAmbiguousVersion in interface DataTypepublic final boolean isGapChar(char c)
public final boolean isGapState(int state)
isGapState in interface DataTypepublic final int getRecommendedGapState()
getRecommendedGapState in interface DataType