org.forester.phylogeny.data
Class BinaryCharacters
java.lang.Object
org.forester.phylogeny.data.BinaryCharacters
- All Implemented Interfaces:
- PhylogenyData
public class BinaryCharacters
- extends Object
- implements PhylogenyData
COUNT_DEFAULT
public static final int COUNT_DEFAULT
- See Also:
- Constant Field Values
BinaryCharacters
public BinaryCharacters()
BinaryCharacters
public BinaryCharacters(SortedSet<String> present_characters,
SortedSet<String> gained_characters,
SortedSet<String> lost_characters,
String type)
BinaryCharacters
public BinaryCharacters(SortedSet<String> present_characters,
SortedSet<String> gained_characters,
SortedSet<String> lost_characters,
String type,
int present_count,
int gained_count,
int lost_count)
addGainedCharacter
public void addGainedCharacter(String binary_character)
addLostCharacter
public void addLostCharacter(String binary_character)
addPresentCharacter
public void addPresentCharacter(String binary_character)
asSimpleText
public StringBuffer asSimpleText()
- Specified by:
asSimpleText
in interface PhylogenyData
asText
public StringBuffer asText()
- Specified by:
asText
in interface PhylogenyData
copy
public PhylogenyData copy()
- Description copied from interface:
PhylogenyData
- Creates a new PhylogenyData object with identical values as this
PhylogenyData.
This ~should~ return a deep copy, but not there yet.
- Specified by:
copy
in interface PhylogenyData
- Returns:
- a ~deep~ copy of this PhylogenyData
getGainedCharacters
public SortedSet<String> getGainedCharacters()
getGainedCharactersAsStringArray
public String[] getGainedCharactersAsStringArray()
getGainedCharactersAsStringBuffer
public StringBuffer getGainedCharactersAsStringBuffer()
getGainedCount
public int getGainedCount()
getLostCharacters
public SortedSet<String> getLostCharacters()
getLostCharactersAsStringArray
public String[] getLostCharactersAsStringArray()
getLostCharactersAsStringBuffer
public StringBuffer getLostCharactersAsStringBuffer()
getLostCount
public int getLostCount()
getPresentCharacters
public SortedSet<String> getPresentCharacters()
getPresentCharactersAsStringArray
public String[] getPresentCharactersAsStringArray()
getPresentCharactersAsStringBuffer
public StringBuffer getPresentCharactersAsStringBuffer()
getPresentCount
public int getPresentCount()
getType
public String getType()
isEqual
public boolean isEqual(PhylogenyData data)
- Description copied from interface:
PhylogenyData
- Compares this PhylogenyData to PhylogenyData data. In general, this
should return true if and only if all fiels are exactly identical.
- Specified by:
isEqual
in interface PhylogenyData
- Returns:
- in general, true if and only if all fiels are exactly identical,
false otherwise
setType
public void setType(String type)
toNHX
public StringBuffer toNHX()
- Specified by:
toNHX
in interface PhylogenyData
toPhyloXML
public void toPhyloXML(Writer writer,
int level,
String indentation)
throws IOException
- Description copied from interface:
PhylogenyData
- Writes a phyloXML representation of this phylogeny data.
- Specified by:
toPhyloXML
in interface PhylogenyData
- Throws:
IOException
toString
public String toString()
- Overrides:
toString
in class Object