|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biojava.utils.Unchangeable
org.biojava.bio.symbol.DoubleAlphabet.SubDoubleAlphabet
public static class DoubleAlphabet.SubDoubleAlphabet
A class to represent a contiguous range of double symbols.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable |
|---|
Annotatable.AnnotationForwarder |
| Field Summary |
|---|
| Fields inherited from interface org.biojava.bio.symbol.Alphabet |
|---|
EMPTY_ALPHABET, PARSERS, SYMBOLS |
| Fields inherited from interface org.biojava.bio.Annotatable |
|---|
ANNOTATION |
| Method Summary | |
|---|---|
boolean |
contains(Symbol s)
Returns whether or not this Alphabet contains the symbol. |
List |
getAlphabets()
Return an ordered List of the alphabets which make up a compound alphabet. |
Symbol |
getAmbiguity(Set syms)
Get a symbol that represents the set of symbols in syms. |
Annotation |
getAnnotation()
Should return the associated annotation object. |
Symbol |
getGapSymbol()
Get the 'gap' ambiguity symbol that is most appropriate for this alphabet. |
String |
getName()
Get the name of the alphabet. |
DoubleAlphabet.DoubleSymbol |
getSymbol(double val)
|
Symbol |
getSymbol(List rl)
Get a symbol from the Alphabet which corresponds to the specified ordered list of symbols. |
SymbolTokenization |
getTokenization(String name)
Get a SymbolTokenization by name. |
protected Object |
readResolve()
To prevent duplication of a what should be a single instance of an existing alphabet. |
void |
validate(Symbol sym)
Throws a precanned IllegalSymbolException if the symbol is not contained within this Alphabet. |
| Methods inherited from class org.biojava.utils.Unchangeable |
|---|
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarder |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.biojava.utils.Changeable |
|---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
| Method Detail |
|---|
protected Object readResolve()
throws ObjectStreamException
ObjectStreamExceptionpublic String getName()
Alphabet
getName in interface Alphabetpublic Annotation getAnnotation()
Annotatable
getAnnotation in interface Annotatablepublic List getAlphabets()
Alphabet
getAlphabets in interface Alphabet
public Symbol getSymbol(List rl)
throws IllegalSymbolException
AlphabetGet a symbol from the Alphabet which corresponds to the specified ordered list of symbols.
The symbol at i in the list must be a member of the i'th alphabet in getAlphabets. If all of the symbols in rl are atomic, then the resulting symbol will also be atomic. If any one of them is an ambiguity symbol then the resulting symbol will be the appropriate ambiguity symbol.
getSymbol in interface Alphabetrl - A list of Symbol instances
IllegalSymbolException - if the members of rl are
not Symbols over the alphabets returned from
getAlphabets
public DoubleAlphabet.DoubleSymbol getSymbol(double val)
throws IllegalSymbolException
IllegalSymbolExceptionpublic Symbol getAmbiguity(Set syms)
AlphabetGet a symbol that represents the set of symbols in syms.
Syms must be a set of Symbol instances each of which is contained within this alphabet. This method is used to retrieve ambiguity symbols.
getAmbiguity in interface Alphabetsyms - the Set of Symbols that will be found in getMatches of the
returned symbol
public Symbol getGapSymbol()
AlphabetGet the 'gap' ambiguity symbol that is most appropriate for this alphabet.
In general, this will be a BasisSymbol that represents a list of AlphabetManager.getGapSymbol() the same length as the getAlphabets list.
getGapSymbol in interface Alphabetpublic boolean contains(Symbol s)
AlphabetReturns whether or not this Alphabet contains the symbol.
An alphabet contains an ambiguity symbol iff the ambiguity symbol's getMatches() returns an alphabet that is a proper sub-set of this alphabet. That means that every one of the symbols that could match the ambiguity symbol is also a member of this alphabet.
contains in interface Alphabets - the Symbol to check
public void validate(Symbol sym)
throws IllegalSymbolException
AlphabetThrows a precanned IllegalSymbolException if the symbol is not contained within this Alphabet.
This function is used all over the code to validate symbols as they enter a method. Also, the code is littered with catches for IllegalSymbolException. There is a preferred style of handling this, which should be covererd in the package documentation.
validate in interface Alphabetsym - the Symbol to validate
IllegalSymbolException - if r is not contained in this alphabet
public SymbolTokenization getTokenization(String name)
throws BioException
AlphabetGet a SymbolTokenization by name.
The parser returned is guaranteed to return Symbols and SymbolLists that conform to this alphabet.
Every alphabet should have a SymbolTokenzation under the name 'token' that uses the symbol token characters to translate a string into a SymbolList. Likewise, there should be a SymbolTokenization under the name 'name' that uses symbol names to identify symbols. Any other names may also be defined, but the behaviour of the returned SymbolTokenization is not defined here.
A SymbolTokenization under the name 'default' should be defined for all sequences, that determines the behavior when printing out a sequence. Standard behavior is to define the 'token' SymbolTokenization as default if it exists, else to define the 'name' SymbolTokenization as the default, but others are possible.
getTokenization in interface Alphabetname - the name of the parser
BioException - if for any reason the tokenization could not be built
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||