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 String
A constant representing the name of Characters blocks. -
Constructor Summary
ConstructorsModifierConstructorDescriptionDelegates to NexusBlock.Abstract constructor using CharactersBlock.CHARACTERS_BLOCK as the name.protected
CharactersBlock
(String replacementLabel) For the DATA block subclass. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCharLabel
(String charLabel) void
addCharState
(String charState) void
addCharStateKeyword
(String charState, String keyword) void
addComment
(NexusComment comment) Adds a comment.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) boolean
containsCharLabel
(String charLabel) boolean
containsTaxLabel
(String taxLabel) Checks to see if we contain the given TAXLABEL.getCharStateLabel
(String charState) getCharStateLabelKeywords
(String charState) Returns all comments.int
Get the NCHAR value.int
Get the NTAX value.int
int
getGap()
getItems()
getMatrixData
(String taxa) getStateLabels
(String state) Get the TAXLABEL values added so far.boolean
boolean
isLabels()
boolean
boolean
isTokens()
boolean
void
void
void
removeCharLabel
(String charLabel) void
removeCharState
(String charState) void
removeComment
(NexusComment comment) Removes a comment.void
removeEquate
(String symbol) void
removeItem
(String item) void
removeState
(String state) void
removeSymbol
(String symbol) void
removeTaxLabel
(String taxLabel) Removes the given TAXLABEL.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 void
writeBlockContents
(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.Abstract
Implement this to write out block contents, not including the BEGIN and END tags.- Specified by:
writeBlockContents
in classNexusBlock.Abstract
- Parameters:
writer
- the writer to write to.- Throws:
IOException
- if writing failed.
-