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 voidaddCharLabel(String charLabel)voidaddCharState(String charState)voidaddCharStateKeyword(String charState, String keyword)protected voidaddComment(NexusComment comment)Tell the builder to add the given comment at the current location.voidaddEquate(String symbol, List symbols)voidaddItem(String item)voidaddMatrixEntry(String taxa)voidaddState(String state)voidaddStateLabel(String state, String label)voidaddSymbol(String symbol)voidaddTaxLabel(String taxLabel)Add a TAXLABEL.voidappendMatrixData(String taxa, Object data)voidendBlock()Notifies the parser that a block is ending.voidendTokenGroup()Closing a line (semi-colon encountered).protected CharactersBlockmakeNewBlock()protected voidresetStatus()Allowed to be called by DATA subclass.voidsetCharStateLabel(String charState, String label)voidsetDataType(String dataType)voidsetDimensionsNChar(int dimensionsNChar)Set the NCHAR value.voidsetDimensionsNTax(int dimensionsNTax)Set the NTAX value.voidsetEliminateEnd(int eliminateEnd)voidsetEliminateStart(int eliminateStart)voidsetGap(String gap)voidsetInterleaved(boolean interleaved)voidsetLabels(boolean labels)voidsetMatchChar(String matchChar)voidsetMissing(String missing)voidsetRespectCase(boolean respectCase)voidsetStatesFormat(String statesFormat)voidsetTokens(boolean tokens)voidsetTransposed(boolean transposed)protected NexusBlockstartBlockObject()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.AbstractTell the builder to add the given comment at the current location.- Specified by:
addCommentin classNexusBlockBuilder.Abstract- Parameters:
comment- the comment to add.
-
makeNewBlock
protected CharactersBlock makeNewBlock()
-
startBlockObject
protected NexusBlock startBlockObject()
Description copied from class:NexusBlockBuilder.AbstractTell the builder to start a new block object.- Specified by:
startBlockObjectin classNexusBlockBuilder.Abstract
-
resetStatus
protected void resetStatus()
Allowed to be called by DATA subclass.
-
endBlock
public void endBlock()
Description copied from interface:NexusBlockListenerNotifies the parser that a block is ending.- Specified by:
endBlockin interfaceNexusBlockListener
-
endTokenGroup
public void endTokenGroup()
Description copied from interface:NexusBlockListenerClosing a line (semi-colon encountered). This indicates that anything received after it is on the next logical line of the block.- Specified by:
endTokenGroupin interfaceNexusBlockListener
-
addCharLabel
public void addCharLabel(String charLabel)
- Specified by:
addCharLabelin interfaceCharactersBlockListener
-
addCharState
public void addCharState(String charState)
- Specified by:
addCharStatein interfaceCharactersBlockListener
-
addCharStateKeyword
public void addCharStateKeyword(String charState, String keyword)
- Specified by:
addCharStateKeywordin interfaceCharactersBlockListener
-
addEquate
public void addEquate(String symbol, List symbols)
- Specified by:
addEquatein interfaceCharactersBlockListener
-
addItem
public void addItem(String item)
- Specified by:
addItemin interfaceCharactersBlockListener
-
addMatrixEntry
public void addMatrixEntry(String taxa)
- Specified by:
addMatrixEntryin interfaceCharactersBlockListener
-
addState
public void addState(String state)
- Specified by:
addStatein interfaceCharactersBlockListener
-
addStateLabel
public void addStateLabel(String state, String label)
- Specified by:
addStateLabelin interfaceCharactersBlockListener
-
addSymbol
public void addSymbol(String symbol)
- Specified by:
addSymbolin interfaceCharactersBlockListener
-
addTaxLabel
public void addTaxLabel(String taxLabel) throws ParseException
Description copied from interface:CharactersBlockListenerAdd 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:
addTaxLabelin 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:
appendMatrixDatain interfaceCharactersBlockListener
-
setCharStateLabel
public void setCharStateLabel(String charState, String label)
- Specified by:
setCharStateLabelin interfaceCharactersBlockListener
-
setDataType
public void setDataType(String dataType)
- Specified by:
setDataTypein interfaceCharactersBlockListener
-
setDimensionsNChar
public void setDimensionsNChar(int dimensionsNChar)
Description copied from interface:CharactersBlockListenerSet the NCHAR value.- Specified by:
setDimensionsNCharin interfaceCharactersBlockListener- Parameters:
dimensionsNChar- the NCHAR value.
-
setDimensionsNTax
public void setDimensionsNTax(int dimensionsNTax)
Description copied from interface:CharactersBlockListenerSet the NTAX value.- Specified by:
setDimensionsNTaxin interfaceCharactersBlockListener- Parameters:
dimensionsNTax- the NTAX value.
-
setEliminateEnd
public void setEliminateEnd(int eliminateEnd)
- Specified by:
setEliminateEndin interfaceCharactersBlockListener
-
setEliminateStart
public void setEliminateStart(int eliminateStart)
- Specified by:
setEliminateStartin interfaceCharactersBlockListener
-
setGap
public void setGap(String gap)
- Specified by:
setGapin interfaceCharactersBlockListener
-
setInterleaved
public void setInterleaved(boolean interleaved)
- Specified by:
setInterleavedin interfaceCharactersBlockListener
-
setLabels
public void setLabels(boolean labels)
- Specified by:
setLabelsin interfaceCharactersBlockListener
-
setMatchChar
public void setMatchChar(String matchChar)
- Specified by:
setMatchCharin interfaceCharactersBlockListener
-
setMissing
public void setMissing(String missing)
- Specified by:
setMissingin interfaceCharactersBlockListener
-
setRespectCase
public void setRespectCase(boolean respectCase)
- Specified by:
setRespectCasein interfaceCharactersBlockListener
-
setStatesFormat
public void setStatesFormat(String statesFormat)
- Specified by:
setStatesFormatin interfaceCharactersBlockListener
-
setTokens
public void setTokens(boolean tokens)
- Specified by:
setTokensin interfaceCharactersBlockListener
-
setTransposed
public void setTransposed(boolean transposed)
- Specified by:
setTransposedin interfaceCharactersBlockListener
-
-