public class TokenSetTools extends java.lang.Object
TokenSet
.Constructor and Description |
---|
TokenSetTools() |
Modifier and Type | Method and Description |
---|---|
static <T> CharacterSymbolMeaning |
getMeaning(TokenSet<T> tokenSet,
T token)
Determines the meaning of the specified token as defined by
TokenSet.getMeaning(Object) . |
static <T> CharacterSymbolType |
getSymbolType(TokenSet<T> tokenSet,
T token)
Returns
CharacterSymbolType.UNCERTAIN for all missing information tokens. |
static <T> boolean |
isGapToken(TokenSet<T> tokenSet,
T token)
Tests if the specified token represents a gap in the specified token set.
|
static <T> boolean |
isMissingInformationToken(TokenSet<T> tokenSet,
T token)
Tests if the specified token represents missing data in the specified token set.
|
static int |
maxRepresentationLength(TokenSet tokenSet)
Calculates the maximal length of a representation returned by
#representationByToken(Object)
of all tokens contained in the specified set. |
static boolean |
representationLengthEqual(TokenSet tokenSet)
Checks if all representation strings returned by
#representationByToken(Object)
have the same length. |
public TokenSetTools()
public static int maxRepresentationLength(TokenSet tokenSet)
#representationByToken(Object)
of all tokens contained in the specified set.tokenSet
- the set to be examinedpublic static boolean representationLengthEqual(TokenSet tokenSet)
#representationByToken(Object)
have the same length.tokenSet
- the set to be examinedtrue
if all lengths are equal, false
otherwisepublic static <T> boolean isGapToken(TokenSet<T> tokenSet, T token)
tokenSet
- the token set containing the specified tokentoken
- the token to be testedtrue
if the specified token is recognized as a gap, false
otherwise.public static <T> boolean isMissingInformationToken(TokenSet<T> tokenSet, T token)
tokenSet
- the token set containing the specified tokentoken
- the token to be testedtrue
if the specified token is recognized as a missing data symbol, false
otherwise.public static <T> CharacterSymbolType getSymbolType(TokenSet<T> tokenSet, T token)
CharacterSymbolType.UNCERTAIN
for all missing information tokens. If TokenSet.getType()
of
tokenSet
specifies a nucleotide or amino acid token set, CharacterSymbolType.UNCERTAIN
is returned for
all tokens which have a IUPAC ambiguity code string representation (as returned by
TokenSet.representationByToken(Object)
). In all other cases CharacterSymbolType.ATOMIC_STATE
is returned.tokenSet
- the token set containing the specified tokentoken
- the token to be testedpublic static <T> CharacterSymbolMeaning getMeaning(TokenSet<T> tokenSet, T token)
TokenSet.getMeaning(Object)
.
This default implementation will return CharacterSymbolMeaning.GAP
for all tokens which are positively tested
by TokenSet.isGapToken(Object)
and CharacterSymbolMeaning.MISSING
for all tokens which are positively
tested by TokenSet.isMissingInformationToken(Object)
. In all other cases
CharacterSymbolMeaning.CHARACTER_STATE
is returned.
tokenSet
- the token set containing the specified tokentoken
- the token to be tested