public class CharacterTokenSet extends AbstractTokenSet<java.lang.Character>
Constructor and Description |
---|
CharacterTokenSet(CharacterStateSetType type)
Creates a new empty instance of this class.
|
CharacterTokenSet(CharacterStateSetType type,
java.lang.CharSequence tokens)
Creates a new instance of this class where the initial tokens are determined
by the characters in the specified character sequence.
|
CharacterTokenSet(CharacterTokenSet tokenSet)
A constructor used to clone instances of this class.
|
Modifier and Type | Method and Description |
---|---|
CharacterTokenSet |
clone()
Clones this instance.
|
java.lang.String |
descriptionByToken(java.lang.Character token)
In this default implementation the description is equal the character itself.
|
int |
maxRepresentationLength()
Always returns one.
|
static CharacterTokenSet |
newAminoAcidInstance(boolean distinguishCase)
Returns a new instance of this class containing all amino acid tokens (one letter codes),
including the gap token (
'-' ) and ambiguity codes. |
static CharacterTokenSet |
newDNAInstance(boolean distinguishCase)
Returns a new instance of this class containing all nucleotide tokens, including
'T' and not 'U' , the gap token ('-' ) and all IUPAC ambiguity codes. |
static CharacterTokenSet |
newNucleotideInstance(boolean distinguishCase)
Returns a new instance of this class containing all nucleotide tokens, including both
'T' and 'U' , the gap token ('-' ) and all IUPAC ambiguity codes. |
static CharacterTokenSet |
newRNAInstance(boolean distinguishCase)
Returns a new instance of this class containing all nucleotide tokens, including
'U' and not 'T' , the gap token ('-' ) and all IUPAC ambiguity codes. |
java.lang.String |
representationByToken(java.lang.Character token)
Returns the character itself.
|
boolean |
representationLengthEqual()
Always returns
true . |
java.lang.Character |
tokenByRepresentation(java.lang.String representation)
Returns the first character of
representation if that character is contained in this set. |
addSpaceKeyForGaps, getGapToken, getKeyMap, getMeaning, getMissingInformationToken, getSymbolType, getType, isGapToken, isMissingInformationToken, isSpaceForGap, setSpaceForGap, tokenByKeyStroke
add, clear, contains, isEmpty, iterator, remove, size, spliterator
addAll, containsAll, retainAll, toArray, toArray, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
public CharacterTokenSet(CharacterStateSetType type)
type
- the token type of the new instance (Only a discrete type would make sense for this class.)public CharacterTokenSet(CharacterStateSetType type, java.lang.CharSequence tokens)
type
- the token type of the new instance (Only a discrete type would make sense for this class.)tokens
- a sequence containing the tokens to be contained in this setpublic CharacterTokenSet(CharacterTokenSet tokenSet)
tokenSet
- the instance to be clonedpublic static CharacterTokenSet newNucleotideInstance(boolean distinguishCase)
'T'
and 'U'
, the gap token ('-'
) and all IUPAC ambiguity codes.public static CharacterTokenSet newDNAInstance(boolean distinguishCase)
'T'
and not 'U'
, the gap token ('-'
) and all IUPAC ambiguity codes.public static CharacterTokenSet newRNAInstance(boolean distinguishCase)
'U'
and not 'T'
, the gap token ('-'
) and all IUPAC ambiguity codes.public static CharacterTokenSet newAminoAcidInstance(boolean distinguishCase)
'-'
) and ambiguity codes.
The returned instance can also be used to take up molecular character data from a stream, where the character type (amino acid or nucleotide) is not known, because all nucleotide characters and ambiguity codes are also contained in the amino acid token set. (That is not the case the other way around.)
public java.lang.String representationByToken(java.lang.Character token)
token
- the token associated with the representationtoken
public java.lang.Character tokenByRepresentation(java.lang.String representation)
representation
if that character is contained in this set.representation
- the string representation of the token (This would usually be the token itself in this class.)null
if no according token is contained in this setTokenSet.tokenByRepresentation(java.lang.String)
public int maxRepresentationLength()
representationByToken(Character)
.1
public boolean representationLengthEqual()
true
. Overwrite this method if you overwrite
representationByToken(Character)
.true
public java.lang.String descriptionByToken(java.lang.Character token)
token
- the token that shall be describedtoken
public CharacterTokenSet clone()
clone
in interface TokenSet<java.lang.Character>
clone
in class AbstractTokenSet<java.lang.Character>