Added getValues and write to DistanceMatrix interface for broader use
[jalview.git] / forester / java / src / org / forester / phylogeny / data / Taxonomy.java
index 4a333a2..8548fe6 100644 (file)
@@ -35,6 +35,7 @@ import org.forester.io.parsers.phyloxml.PhyloXmlDataFormatException;
 import org.forester.io.parsers.phyloxml.PhyloXmlMapping;
 import org.forester.io.parsers.phyloxml.PhyloXmlUtil;
 import org.forester.util.ForesterUtil;
+import org.forester.util.TaxonomyUtil;
 
 public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonomy> {
 
@@ -248,8 +249,8 @@ public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
 
     public boolean isEmpty() {
         return ( ( getIdentifier() == null ) && ForesterUtil.isEmpty( getTaxonomyCode() )
-                && ForesterUtil.isEmpty( getCommonName() ) && ForesterUtil.isEmpty( getScientificName() ) && ForesterUtil
-                .isEmpty( _lineage ) );
+                && ForesterUtil.isEmpty( getCommonName() ) && ForesterUtil.isEmpty( getScientificName() )
+                && ForesterUtil.isEmpty( _lineage ) );
     }
 
     /**
@@ -304,7 +305,7 @@ public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
     }
 
     public void setRank( final String rank ) throws PhyloXmlDataFormatException {
-        if ( !ForesterUtil.isEmpty( rank ) && !PhyloXmlUtil.TAXONOMY_RANKS_SET.contains( rank ) ) {
+        if ( !ForesterUtil.isEmpty( rank ) && !TaxonomyUtil.TAXONOMY_RANKS_SET.contains( rank ) ) {
             throw new PhyloXmlDataFormatException( "illegal rank: [" + rank + "]" );
         }
         _rank = rank;
@@ -323,16 +324,6 @@ public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
                 && !PhyloXmlUtil.TAXOMONY_CODE_PATTERN.matcher( taxonomy_code ).matches() ) {
             throw new PhyloXmlDataFormatException( "illegal taxonomy code: [" + taxonomy_code + "]" );
         }
-        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-        //TODO FIXME (added on 13-11-18) remove me eventually
-        if ( taxonomy_code.equals( "ACIBL" ) ) {
-            taxonomy_code = "KORVE";
-        }
-        else if ( taxonomy_code.equals( "PYRKO" ) ) {
-            taxonomy_code = "THEKO";
-        }
-        //TODO FIXME (added on 13-11-18) remove me eventually
-        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         _taxonomy_code = taxonomy_code;
     }
 
@@ -391,8 +382,10 @@ public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
             PhylogenyDataUtil.appendElement( writer, PhyloXmlMapping.TAXONOMY_AUTHORITY, getAuthority(), indentation );
         }
         if ( !ForesterUtil.isEmpty( getCommonName() ) ) {
-            PhylogenyDataUtil
-            .appendElement( writer, PhyloXmlMapping.TAXONOMY_COMMON_NAME, getCommonName(), indentation );
+            PhylogenyDataUtil.appendElement( writer,
+                                             PhyloXmlMapping.TAXONOMY_COMMON_NAME,
+                                             getCommonName(),
+                                             indentation );
         }
         if ( _synonyms != null ) {
             for( final String syn : getSynonyms() ) {