info.bioinfweb.treegraph.document.io.newick
Class NewickScanner
java.lang.Object
info.bioinfweb.treegraph.document.io.newick.NewickStringChars
info.bioinfweb.treegraph.document.io.newick.NewickScanner
public class NewickScanner
- extends NewickStringChars
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NewickScanner
public NewickScanner()
readFreeName
private static NewickToken readFreeName(String text,
int start)
readDelimitedName
private static int readDelimitedName(String text,
int start,
NewickToken token)
readBranchLength
private static int readBranchLength(String text,
int start,
NewickToken token)
- Reads a length statement in an Newick string.
- Parameters:
token
- the token where the length value shall be storedtext
- the Newick stringstart
- ste start position of the length statement
- Returns:
- the position to go on tokenizing
readComment
private static int readComment(String text,
int start,
List<NewickToken> tokenList)
- Reads a comment and adds it to last token in the passed list. If the comment is a rooted- or
unrooted-command the according token is added.
- Parameters:
text
- start
- tokenList
-
- Returns:
-
- Throws:
NewickException
- if the comment is unterminated
parse
public static List<NewickToken> parse(String text)