Package org.biojavax.bio.phylo.io.nexus
Class CharactersBlockBuilder
java.lang.Object
org.biojavax.bio.phylo.io.nexus.NexusBlockBuilder.Abstract
org.biojavax.bio.phylo.io.nexus.CharactersBlockBuilder
- All Implemented Interfaces:
CharactersBlockListener
,NexusBlockBuilder
,NexusBlockListener
- Direct Known Subclasses:
DataBlockBuilder
public class CharactersBlockBuilder
extends NexusBlockBuilder.Abstract
implements CharactersBlockListener
Builds Nexus characters blocks.
- Since:
- 1.6
- Author:
- Richard Holland, Tobias Thierer, Jim Balhoff
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojavax.bio.phylo.io.nexus.NexusBlockBuilder
NexusBlockBuilder.Abstract
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCharLabel
(String charLabel) void
addCharState
(String charState) void
addCharStateKeyword
(String charState, String keyword) protected void
addComment
(NexusComment comment) Tell the builder to add the given comment at the current location.void
void
void
addMatrixEntry
(String taxa) void
void
addStateLabel
(String state, String label) void
void
addTaxLabel
(String taxLabel) Add a TAXLABEL.void
appendMatrixData
(String taxa, Object data) void
endBlock()
Notifies the parser that a block is ending.void
Closing a line (semi-colon encountered).protected CharactersBlock
protected void
Allowed to be called by DATA subclass.void
setCharStateLabel
(String charState, String label) void
setDataType
(String dataType) void
setDimensionsNChar
(int dimensionsNChar) Set the NCHAR value.void
setDimensionsNTax
(int dimensionsNTax) Set the NTAX value.void
setEliminateEnd
(int eliminateEnd) void
setEliminateStart
(int eliminateStart) void
void
setInterleaved
(boolean interleaved) void
setLabels
(boolean labels) void
setMatchChar
(String matchChar) void
setMissing
(String missing) void
setRespectCase
(boolean respectCase) void
setStatesFormat
(String statesFormat) void
setTokens
(boolean tokens) void
setTransposed
(boolean transposed) protected NexusBlock
Tell the builder to start a new block object.Methods inherited from class org.biojavax.bio.phylo.io.nexus.NexusBlockBuilder.Abstract
beginComment, commentText, endComment, getBlockName, getNexusBlock, startBlock
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.biojavax.bio.phylo.io.nexus.NexusBlockListener
beginComment, commentText, endComment, startBlock
-
Constructor Details
-
CharactersBlockBuilder
public CharactersBlockBuilder()
-
-
Method Details
-
addComment
Description copied from class:NexusBlockBuilder.Abstract
Tell the builder to add the given comment at the current location.- Specified by:
addComment
in classNexusBlockBuilder.Abstract
- Parameters:
comment
- the comment to add.
-
makeNewBlock
-
startBlockObject
Description copied from class:NexusBlockBuilder.Abstract
Tell the builder to start a new block object.- Specified by:
startBlockObject
in classNexusBlockBuilder.Abstract
-
resetStatus
Allowed to be called by DATA subclass. -
endBlock
Description copied from interface:NexusBlockListener
Notifies the parser that a block is ending.- Specified by:
endBlock
in interfaceNexusBlockListener
-
endTokenGroup
Description copied from interface:NexusBlockListener
Closing a line (semi-colon encountered). This indicates that anything received after it is on the next logical line of the block.- Specified by:
endTokenGroup
in interfaceNexusBlockListener
-
addCharLabel
- Specified by:
addCharLabel
in interfaceCharactersBlockListener
-
addCharState
- Specified by:
addCharState
in interfaceCharactersBlockListener
-
addCharStateKeyword
- Specified by:
addCharStateKeyword
in interfaceCharactersBlockListener
-
addEquate
- Specified by:
addEquate
in interfaceCharactersBlockListener
-
addItem
- Specified by:
addItem
in interfaceCharactersBlockListener
-
addMatrixEntry
- Specified by:
addMatrixEntry
in interfaceCharactersBlockListener
-
addState
- Specified by:
addState
in interfaceCharactersBlockListener
-
addStateLabel
- Specified by:
addStateLabel
in interfaceCharactersBlockListener
-
addSymbol
- Specified by:
addSymbol
in interfaceCharactersBlockListener
-
addTaxLabel
Description copied from interface:CharactersBlockListener
Add a TAXLABEL. If it already exists, or is a number that refers to an index position that already exists, an exception is thrown.- Specified by:
addTaxLabel
in interfaceCharactersBlockListener
- Parameters:
taxLabel
- the label to add.- Throws:
ParseException
- if the label cannot be added.
-
appendMatrixData
- Specified by:
appendMatrixData
in interfaceCharactersBlockListener
-
setCharStateLabel
- Specified by:
setCharStateLabel
in interfaceCharactersBlockListener
-
setDataType
- Specified by:
setDataType
in interfaceCharactersBlockListener
-
setDimensionsNChar
Description copied from interface:CharactersBlockListener
Set the NCHAR value.- Specified by:
setDimensionsNChar
in interfaceCharactersBlockListener
- Parameters:
dimensionsNChar
- the NCHAR value.
-
setDimensionsNTax
Description copied from interface:CharactersBlockListener
Set the NTAX value.- Specified by:
setDimensionsNTax
in interfaceCharactersBlockListener
- Parameters:
dimensionsNTax
- the NTAX value.
-
setEliminateEnd
- Specified by:
setEliminateEnd
in interfaceCharactersBlockListener
-
setEliminateStart
- Specified by:
setEliminateStart
in interfaceCharactersBlockListener
-
setGap
- Specified by:
setGap
in interfaceCharactersBlockListener
-
setInterleaved
- Specified by:
setInterleaved
in interfaceCharactersBlockListener
-
setLabels
- Specified by:
setLabels
in interfaceCharactersBlockListener
-
setMatchChar
- Specified by:
setMatchChar
in interfaceCharactersBlockListener
-
setMissing
- Specified by:
setMissing
in interfaceCharactersBlockListener
-
setRespectCase
- Specified by:
setRespectCase
in interfaceCharactersBlockListener
-
setStatesFormat
- Specified by:
setStatesFormat
in interfaceCharactersBlockListener
-
setTokens
- Specified by:
setTokens
in interfaceCharactersBlockListener
-
setTransposed
- Specified by:
setTransposed
in interfaceCharactersBlockListener
-