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 Constructor Description CharactersBlockBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
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
addEquate(String symbol, List symbols)
void
addItem(String item)
void
addMatrixEntry(String taxa)
void
addState(String state)
void
addStateLabel(String state, String label)
void
addSymbol(String symbol)
void
addTaxLabel(String taxLabel)
Add a TAXLABEL.void
appendMatrixData(String taxa, Object data)
void
endBlock()
Notifies the parser that a block is ending.void
endTokenGroup()
Closing a line (semi-colon encountered).protected CharactersBlock
makeNewBlock()
protected void
resetStatus()
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
setGap(String gap)
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
startBlockObject()
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 Detail
-
CharactersBlockBuilder
public CharactersBlockBuilder()
-
-
Method Detail
-
addComment
protected void addComment(NexusComment comment)
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
protected CharactersBlock makeNewBlock()
-
startBlockObject
protected NexusBlock startBlockObject()
Description copied from class:NexusBlockBuilder.Abstract
Tell the builder to start a new block object.- Specified by:
startBlockObject
in classNexusBlockBuilder.Abstract
-
resetStatus
protected void resetStatus()
Allowed to be called by DATA subclass.
-
endBlock
public void endBlock()
Description copied from interface:NexusBlockListener
Notifies the parser that a block is ending.- Specified by:
endBlock
in interfaceNexusBlockListener
-
endTokenGroup
public void 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
public void addCharLabel(String charLabel)
- Specified by:
addCharLabel
in interfaceCharactersBlockListener
-
addCharState
public void addCharState(String charState)
- Specified by:
addCharState
in interfaceCharactersBlockListener
-
addCharStateKeyword
public void addCharStateKeyword(String charState, String keyword)
- Specified by:
addCharStateKeyword
in interfaceCharactersBlockListener
-
addEquate
public void addEquate(String symbol, List symbols)
- Specified by:
addEquate
in interfaceCharactersBlockListener
-
addItem
public void addItem(String item)
- Specified by:
addItem
in interfaceCharactersBlockListener
-
addMatrixEntry
public void addMatrixEntry(String taxa)
- Specified by:
addMatrixEntry
in interfaceCharactersBlockListener
-
addState
public void addState(String state)
- Specified by:
addState
in interfaceCharactersBlockListener
-
addStateLabel
public void addStateLabel(String state, String label)
- Specified by:
addStateLabel
in interfaceCharactersBlockListener
-
addSymbol
public void addSymbol(String symbol)
- Specified by:
addSymbol
in interfaceCharactersBlockListener
-
addTaxLabel
public void addTaxLabel(String taxLabel) throws ParseException
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
public void appendMatrixData(String taxa, Object data)
- Specified by:
appendMatrixData
in interfaceCharactersBlockListener
-
setCharStateLabel
public void setCharStateLabel(String charState, String label)
- Specified by:
setCharStateLabel
in interfaceCharactersBlockListener
-
setDataType
public void setDataType(String dataType)
- Specified by:
setDataType
in interfaceCharactersBlockListener
-
setDimensionsNChar
public void setDimensionsNChar(int dimensionsNChar)
Description copied from interface:CharactersBlockListener
Set the NCHAR value.- Specified by:
setDimensionsNChar
in interfaceCharactersBlockListener
- Parameters:
dimensionsNChar
- the NCHAR value.
-
setDimensionsNTax
public void setDimensionsNTax(int dimensionsNTax)
Description copied from interface:CharactersBlockListener
Set the NTAX value.- Specified by:
setDimensionsNTax
in interfaceCharactersBlockListener
- Parameters:
dimensionsNTax
- the NTAX value.
-
setEliminateEnd
public void setEliminateEnd(int eliminateEnd)
- Specified by:
setEliminateEnd
in interfaceCharactersBlockListener
-
setEliminateStart
public void setEliminateStart(int eliminateStart)
- Specified by:
setEliminateStart
in interfaceCharactersBlockListener
-
setGap
public void setGap(String gap)
- Specified by:
setGap
in interfaceCharactersBlockListener
-
setInterleaved
public void setInterleaved(boolean interleaved)
- Specified by:
setInterleaved
in interfaceCharactersBlockListener
-
setLabels
public void setLabels(boolean labels)
- Specified by:
setLabels
in interfaceCharactersBlockListener
-
setMatchChar
public void setMatchChar(String matchChar)
- Specified by:
setMatchChar
in interfaceCharactersBlockListener
-
setMissing
public void setMissing(String missing)
- Specified by:
setMissing
in interfaceCharactersBlockListener
-
setRespectCase
public void setRespectCase(boolean respectCase)
- Specified by:
setRespectCase
in interfaceCharactersBlockListener
-
setStatesFormat
public void setStatesFormat(String statesFormat)
- Specified by:
setStatesFormat
in interfaceCharactersBlockListener
-
setTokens
public void setTokens(boolean tokens)
- Specified by:
setTokens
in interfaceCharactersBlockListener
-
setTransposed
public void setTransposed(boolean transposed)
- Specified by:
setTransposed
in interfaceCharactersBlockListener
-
-