org.forester.phylogenyinference
Class BasicCharacterStateMatrix<S>
java.lang.Object
org.forester.phylogenyinference.BasicCharacterStateMatrix<S>
- All Implemented Interfaces:
- CharacterStateMatrix<S>
public class BasicCharacterStateMatrix<S>
- extends Object
- implements CharacterStateMatrix<S>
Method Summary |
boolean |
containsCharacter(String character)
|
boolean |
containsIdentifier(String identifier)
|
CharacterStateMatrix<S> |
copy()
|
boolean |
equals(Object o)
|
String |
getCharacter(int character_index)
|
int |
getCharacterIndex(String character)
|
String |
getIdentifier(int identifier_index)
|
int |
getIdentifierIndex(String identifier)
|
int |
getNumberOfCharacters()
|
int |
getNumberOfIdentifiers()
|
S |
getState(int identifier_index,
int character_index)
|
S |
getState(String identifier,
int character_index)
|
S |
getState(String identifier,
String character)
|
boolean |
isEmpty()
|
CharacterStateMatrix<S> |
pivot()
|
void |
setCharacter(int character_index,
String character)
|
void |
setIdentifier(int identifier_index,
String identifier)
|
void |
setState(int identifier_index,
int character_index,
S state)
|
void |
setState(String identifier,
int character_index,
S state)
|
void |
setState(String identifier,
String character,
S state)
|
void |
toWriter(Writer writer)
|
void |
toWriter(Writer writer,
CharacterStateMatrix.Format format)
|
void |
writeNexusBinaryChractersBlock(Writer w)
|
void |
writeNexusCharstatelabels(Writer w)
|
void |
writeNexusMatrix(Writer w)
|
void |
writeNexusTaxaBlock(Writer w)
|
BasicCharacterStateMatrix
public BasicCharacterStateMatrix(int number_of_identifiers,
int number_of_characters)
BasicCharacterStateMatrix
public BasicCharacterStateMatrix(int number_of_identifiers,
int number_of_characters,
S default_state)
BasicCharacterStateMatrix
public BasicCharacterStateMatrix(List<List<S>> states)
BasicCharacterStateMatrix
public BasicCharacterStateMatrix(S[][] states)
containsCharacter
public boolean containsCharacter(String character)
- Specified by:
containsCharacter
in interface CharacterStateMatrix<S>
containsIdentifier
public boolean containsIdentifier(String identifier)
- Specified by:
containsIdentifier
in interface CharacterStateMatrix<S>
copy
public CharacterStateMatrix<S> copy()
- Specified by:
copy
in interface CharacterStateMatrix<S>
equals
public boolean equals(Object o)
- Overrides:
equals
in class Object
getCharacter
public String getCharacter(int character_index)
- Specified by:
getCharacter
in interface CharacterStateMatrix<S>
getCharacterIndex
public int getCharacterIndex(String character)
- Specified by:
getCharacterIndex
in interface CharacterStateMatrix<S>
getIdentifier
public String getIdentifier(int identifier_index)
- Specified by:
getIdentifier
in interface CharacterStateMatrix<S>
getIdentifierIndex
public int getIdentifierIndex(String identifier)
- Specified by:
getIdentifierIndex
in interface CharacterStateMatrix<S>
getNumberOfCharacters
public int getNumberOfCharacters()
- Specified by:
getNumberOfCharacters
in interface CharacterStateMatrix<S>
getNumberOfIdentifiers
public int getNumberOfIdentifiers()
- Specified by:
getNumberOfIdentifiers
in interface CharacterStateMatrix<S>
getState
public S getState(int identifier_index,
int character_index)
- Specified by:
getState
in interface CharacterStateMatrix<S>
getState
public S getState(String identifier,
int character_index)
- Specified by:
getState
in interface CharacterStateMatrix<S>
getState
public S getState(String identifier,
String character)
- Specified by:
getState
in interface CharacterStateMatrix<S>
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface CharacterStateMatrix<S>
pivot
public CharacterStateMatrix<S> pivot()
- Specified by:
pivot
in interface CharacterStateMatrix<S>
setCharacter
public void setCharacter(int character_index,
String character)
- Specified by:
setCharacter
in interface CharacterStateMatrix<S>
setIdentifier
public void setIdentifier(int identifier_index,
String identifier)
- Specified by:
setIdentifier
in interface CharacterStateMatrix<S>
setState
public void setState(int identifier_index,
int character_index,
S state)
- Specified by:
setState
in interface CharacterStateMatrix<S>
setState
public void setState(String identifier,
int character_index,
S state)
- Specified by:
setState
in interface CharacterStateMatrix<S>
setState
public void setState(String identifier,
String character,
S state)
- Specified by:
setState
in interface CharacterStateMatrix<S>
toWriter
public void toWriter(Writer writer)
throws IOException
- Specified by:
toWriter
in interface CharacterStateMatrix<S>
- Throws:
IOException
toWriter
public void toWriter(Writer writer,
CharacterStateMatrix.Format format)
throws IOException
- Specified by:
toWriter
in interface CharacterStateMatrix<S>
- Throws:
IOException
writeNexusBinaryChractersBlock
public void writeNexusBinaryChractersBlock(Writer w)
throws IOException
- Throws:
IOException
writeNexusCharstatelabels
public void writeNexusCharstatelabels(Writer w)
throws IOException
- Throws:
IOException
writeNexusMatrix
public void writeNexusMatrix(Writer w)
throws IOException
- Throws:
IOException
writeNexusTaxaBlock
public void writeNexusTaxaBlock(Writer w)
throws IOException
- Throws:
IOException