info.bioinfweb.treegraph.document.io.nexus
Class NexusParser
java.lang.Object
info.bioinfweb.treegraph.document.io.nexus.NexusParser
public class NexusParser
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NAME_NEXUS
public static final String NAME_NEXUS
- See Also:
- Constant Field Values
COMMENT_START
public static final char COMMENT_START
- See Also:
- Constant Field Values
COMMENT_END
public static final char COMMENT_END
- See Also:
- Constant Field Values
NAME_DELIMITER
public static final char NAME_DELIMITER
- See Also:
- Constant Field Values
NAME_SEPARATOR_PATTERN
public static final Pattern NAME_SEPARATOR_PATTERN
ENCLOSED_NAME_PATTERN
public static final Pattern ENCLOSED_NAME_PATTERN
COMMAND_SEPARATOR
public static final char COMMAND_SEPARATOR
- See Also:
- Constant Field Values
COMMAND_PATTERN
public static final Pattern COMMAND_PATTERN
ROOTED_COMMAND
public static final String ROOTED_COMMAND
- See Also:
- Constant Field Values
UNROOTED_COMMAND
public static final String UNROOTED_COMMAND
- See Also:
- Constant Field Values
NAME_BLOCK_BEGIN
public static final String NAME_BLOCK_BEGIN
- See Also:
- Constant Field Values
BLOCK_BEGIN_PATTERN
public static final Pattern BLOCK_BEGIN_PATTERN
NAME_BLOCK_END
public static final String NAME_BLOCK_END
- See Also:
- Constant Field Values
BLOCK_END_PATTERN
public static final Pattern BLOCK_END_PATTERN
NAME_TREES
public static final String NAME_TREES
- See Also:
- Constant Field Values
TREES_PATTERN
public static final Pattern TREES_PATTERN
NAME_TRANSL_TABLE
public static final String NAME_TRANSL_TABLE
- See Also:
- Constant Field Values
TRANSL_TABLE_PATTERN
public static final Pattern TRANSL_TABLE_PATTERN
TRANSL_TABLE_SEPARATOR_PATTERN
public static final Pattern TRANSL_TABLE_SEPARATOR_PATTERN
TREE_COMMAND
public static final String TREE_COMMAND
- See Also:
- Constant Field Values
TREE_COMMAND_PATTERN
public static final Pattern TREE_COMMAND_PATTERN
WHITESPACE_PATTERN
public static final Pattern WHITESPACE_PATTERN
EMPTY_PATTERN
public static final Pattern EMPTY_PATTERN
NexusParser
public NexusParser()
scan
private static NexusCommand[] scan(String content)
findCommand
private static int findCommand(NexusCommand[] commands,
int start,
int end,
Pattern namePattern,
Pattern tokenPattern)
- Searches for thr first occurence of the given command.
- Parameters:
commands - - the list if all commandsstart - - the command index to start the searchend - - the command index to stop the searchnamePattern - - the name of the command (The pattern should describe all
possible names. Pattern are not matched case sensitive)tokenPattern - - describes how the token of the command should look like
(The pattern should describe all possible names. Pattern are not matched case
sensitive)
- Returns:
- the index of the first match in the given array of command
findBlockEnd
private static int findBlockEnd(NexusCommand[] commands,
int start,
int end)
parseName
private static String parseName(String name)
readTranslTable
private static void readTranslTable(NexusCommand command,
TranslTable translTable)
parse
public static NexusDocument parse(String content)
throws NexusException
- Throws:
NexusException