org.forester.phylogeny.data
Class Taxonomy
java.lang.Object
org.forester.phylogeny.data.Taxonomy
- All Implemented Interfaces:
- java.lang.Comparable<Taxonomy>, MultipleUris, PhylogenyData
public class Taxonomy
- extends java.lang.Object
- implements PhylogenyData, MultipleUris, java.lang.Comparable<Taxonomy>
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Taxonomy
public Taxonomy()
asSimpleText
public java.lang.StringBuffer asSimpleText()
- Specified by:
asSimpleText in interface PhylogenyData
getUri
public Uri getUri(int index)
- Specified by:
getUri in interface MultipleUris
addUri
public void addUri(Uri uri)
- Specified by:
addUri in interface MultipleUris
asText
public java.lang.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
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals in class java.lang.Object
getAuthority
public java.lang.String getAuthority()
getCommonName
public java.lang.String getCommonName()
getIdentifier
public Identifier getIdentifier()
getRank
public java.lang.String getRank()
getScientificName
public java.lang.String getScientificName()
getSynonyms
public java.util.List<java.lang.String> getSynonyms()
getTaxonomyCode
public java.lang.String getTaxonomyCode()
getUris
public java.util.List<Uri> getUris()
- Specified by:
getUris in interface MultipleUris
hashCode
public int hashCode()
- Overrides:
hashCode in class java.lang.Object
init
public void init()
isEmpty
public boolean isEmpty()
isEqual
public boolean isEqual(PhylogenyData data)
- If this and taxonomy 'data' has an identifier, comparison will be based on that.
Otherwise, if this and taxonomy 'data' has a code, comparison will be based on that.
Otherwise, if Taxonomy 'data' has a scientific name, comparison will be
based on that (case insensitive!).
Otherwise, if Taxonomy 'data' has a common name, comparison will be
based on that (case insensitive!).
(Note. This is important and should not be change without a very good reason.)
- Specified by:
isEqual in interface PhylogenyData
- Returns:
- in general, true if and only if all fiels are exactly identical,
false otherwise
setAuthority
public void setAuthority(java.lang.String authority)
setCommonName
public void setCommonName(java.lang.String common_name)
setIdentifier
public void setIdentifier(Identifier identifier)
setRank
public void setRank(java.lang.String rank)
throws PhyloXmlDataFormatException
- Throws:
PhyloXmlDataFormatException
setScientificName
public void setScientificName(java.lang.String scientific_name)
setTaxonomyCode
public void setTaxonomyCode(java.lang.String taxonomy_code)
throws PhyloXmlDataFormatException
- Throws:
PhyloXmlDataFormatException
setUris
public void setUris(java.util.List<Uri> uris)
- Specified by:
setUris in interface MultipleUris
toNHX
public java.lang.StringBuffer toNHX()
- Specified by:
toNHX in interface PhylogenyData
toPhyloXML
public void toPhyloXML(java.io.Writer writer,
int level,
java.lang.String indentation)
throws java.io.IOException
- Description copied from interface:
PhylogenyData
- Writes a phyloXML representation of this phylogeny data.
- Specified by:
toPhyloXML in interface PhylogenyData
- Throws:
java.io.IOException
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
compareTo
public int compareTo(Taxonomy o)
- Specified by:
compareTo in interface java.lang.Comparable<Taxonomy>
setLineage
public void setLineage(java.util.List<java.lang.String> lineage)
getLineage
public java.util.List<java.lang.String> getLineage()