org.forester.phylogeny.data
Class BinaryCharacters

java.lang.Object
  extended by org.forester.phylogeny.data.BinaryCharacters
All Implemented Interfaces:
PhylogenyData

public class BinaryCharacters
extends Object
implements PhylogenyData


Field Summary
static int COUNT_DEFAULT
           
 
Constructor Summary
BinaryCharacters()
           
BinaryCharacters(SortedSet<String> present_characters, SortedSet<String> gained_characters, SortedSet<String> lost_characters, String type)
           
BinaryCharacters(SortedSet<String> present_characters, SortedSet<String> gained_characters, SortedSet<String> lost_characters, String type, int present_count, int gained_count, int lost_count)
           
 
Method Summary
 void addGainedCharacter(String binary_character)
           
 void addLostCharacter(String binary_character)
           
 void addPresentCharacter(String binary_character)
           
 StringBuffer asSimpleText()
           
 StringBuffer asText()
           
 PhylogenyData copy()
          Creates a new PhylogenyData object with identical values as this PhylogenyData.
 SortedSet<String> getGainedCharacters()
           
 String[] getGainedCharactersAsStringArray()
           
 StringBuffer getGainedCharactersAsStringBuffer()
           
 int getGainedCount()
           
 SortedSet<String> getLostCharacters()
           
 String[] getLostCharactersAsStringArray()
           
 StringBuffer getLostCharactersAsStringBuffer()
           
 int getLostCount()
           
 SortedSet<String> getPresentCharacters()
           
 String[] getPresentCharactersAsStringArray()
           
 StringBuffer getPresentCharactersAsStringBuffer()
           
 int getPresentCount()
           
 String getType()
           
 boolean isEqual(PhylogenyData data)
          Compares this PhylogenyData to PhylogenyData data.
 void setType(String type)
           
 StringBuffer toNHX()
           
 void toPhyloXML(Writer writer, int level, String indentation)
          Writes a phyloXML representation of this phylogeny data.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

COUNT_DEFAULT

public static final int COUNT_DEFAULT
See Also:
Constant Field Values
Constructor Detail

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)
Method Detail

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