Package org.biojavax.bio.phylo.io.nexus
Class CharactersBlock
java.lang.Object
org.biojavax.bio.phylo.io.nexus.NexusBlock.Abstract
org.biojavax.bio.phylo.io.nexus.CharactersBlock
- All Implemented Interfaces:
NexusBlock,NexusObject
- Direct Known Subclasses:
DataBlock
Represents 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.NexusBlock
NexusBlock.Abstract -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringA constant representing the name of Characters blocks. -
Constructor Summary
ConstructorsModifierConstructorDescriptionDelegates to NexusBlock.Abstract constructor using CharactersBlock.CHARACTERS_BLOCK as the name.protectedCharactersBlock(String replacementLabel) For the DATA block subclass. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCharLabel(String charLabel) voidaddCharState(String charState) voidaddCharStateKeyword(String charState, String keyword) voidaddComment(NexusComment comment) Adds a comment.voidvoidvoidaddMatrixEntry(String taxa) voidvoidaddStateLabel(String state, String label) voidvoidaddTaxLabel(String taxLabel) Add a TAXLABEL.voidappendMatrixData(String taxa, Object data) booleancontainsCharLabel(String charLabel) booleancontainsTaxLabel(String taxLabel) Checks to see if we contain the given TAXLABEL.getCharStateLabel(String charState) getCharStateLabelKeywords(String charState) Returns all comments.intGet the NCHAR value.intGet the NTAX value.intintgetGap()getItems()getMatrixData(String taxa) getStateLabels(String state) Get the TAXLABEL values added so far.booleanbooleanisLabels()booleanbooleanisTokens()booleanvoidvoidvoidremoveCharLabel(String charLabel) voidremoveCharState(String charState) voidremoveComment(NexusComment comment) Removes a comment.voidremoveEquate(String symbol) voidremoveItem(String item) voidremoveState(String state) voidremoveSymbol(String symbol) voidremoveTaxLabel(String taxLabel) Removes the given TAXLABEL.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) voidvoidsetInterleaved(boolean interleaved) voidsetLabels(boolean labels) voidsetMatchChar(String matchChar) voidsetMissing(String missing) voidsetRespectCase(boolean respectCase) voidsetStatesFormat(String statesFormat) voidsetTokens(boolean tokens) voidsetTransposed(boolean transposed) protected voidwriteBlockContents(Writer writer) Implement this to write out block contents, not including the BEGIN and END tags.Methods inherited from class org.biojavax.bio.phylo.io.nexus.NexusBlock.Abstract
getBlockName, writeObject, writeToken
-
Field Details
-
CHARACTERS_BLOCK
A constant representing the name of Characters blocks.- See Also:
-
-
Constructor Details
-
CharactersBlock
public CharactersBlock()Delegates to NexusBlock.Abstract constructor using CharactersBlock.CHARACTERS_BLOCK as the name. -
CharactersBlock
For the DATA block subclass.- Parameters:
replacementLabel- the different label to use.
-
-
Method Details
-
setDimensionsNTax
Set the NTAX value.- Parameters:
dimensionsNTax- the NTAX value.
-
getDimensionsNTax
Get the NTAX value.- Returns:
- the NTAX value.
-
setDimensionsNChar
Set the NCHAR value.- Parameters:
dimensionsNChar- the NCHAR value.
-
getDimensionsNChar
Get the NCHAR value.- Returns:
- the NCHAR value.
-
setDataType
-
getDataType
-
setRespectCase
-
isRespectCase
-
setMissing
-
getMissing
-
setGap
-
getGap
-
addSymbol
-
removeSymbol
-
removeAllSymbols
-
getSymbols
-
addEquate
-
removeEquate
-
getEquates
-
setMatchChar
-
getMatchChar
-
setLabels
-
isLabels
-
setTransposed
-
isTransposed
-
setInterleaved
-
isInterleaved
-
addItem
-
removeItem
-
removeAllItems
-
getItems
-
setStatesFormat
-
getStatesFormat
-
setTokens
-
isTokens
-
setEliminateStart
-
getEliminateStart
-
setEliminateEnd
-
getEliminateEnd
-
addTaxLabel
Add a TAXLABEL. If it already exists, or is a number that refers to an index position that already exists, an exception is thrown.- Parameters:
taxLabel- the label to add.- Throws:
ParseException- if the label cannot be added.
-
removeTaxLabel
Removes the given TAXLABEL.- Parameters:
taxLabel- the label to remove.
-
containsTaxLabel
Checks to see if we contain the given TAXLABEL.- Parameters:
taxLabel- the label to check for.- Returns:
- true if we already contain it.
-
getTaxLabels
Get the TAXLABEL values added so far.- Returns:
- this labels so far.
-
addCharState
-
setCharStateLabel
-
addCharStateKeyword
-
getCharStateLabel
-
getCharStateLabelKeywords
-
removeCharState
-
getAllCharStates
-
addCharLabel
-
removeCharLabel
-
containsCharLabel
-
getCharLabels
-
addState
-
addStateLabel
-
getStateLabels
-
removeState
-
addMatrixEntry
-
appendMatrixData
-
getMatrixData
-
getMatrixLabels
-
addComment
Adds a comment.- Parameters:
comment- the comment to add.
-
removeComment
Removes a comment.- Parameters:
comment- the comment to remove.
-
getComments
Returns all comments.- Returns:
- all the selected comments.
-
writeBlockContents
Description copied from class:NexusBlock.AbstractImplement this to write out block contents, not including the BEGIN and END tags.- Specified by:
writeBlockContentsin classNexusBlock.Abstract- Parameters:
writer- the writer to write to.- Throws:
IOException- if writing failed.
-