git://source.jalview.org
/
jalview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
moved to: https://sites.google.com/site/cmzmasek/home/software/forester
[jalview.git]
/
forester
/
java
/
src
/
org
/
forester
/
phylogeny
/
data
/
Taxonomy.java
diff --git
a/forester/java/src/org/forester/phylogeny/data/Taxonomy.java
b/forester/java/src/org/forester/phylogeny/data/Taxonomy.java
index
1375652
..
b354921
100644
(file)
--- a/
forester/java/src/org/forester/phylogeny/data/Taxonomy.java
+++ b/
forester/java/src/org/forester/phylogeny/data/Taxonomy.java
@@
-21,7
+21,7
@@
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
//
// Contact: phylosoft @ gmail . com
-// WWW: www.phylosoft.org/forester
+// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
package org.forester.phylogeny.data;
package org.forester.phylogeny.data;
@@
-109,7
+109,12
@@
public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
@Override
public PhylogenyData copy() {
final Taxonomy t = new Taxonomy();
@Override
public PhylogenyData copy() {
final Taxonomy t = new Taxonomy();
- t.setTaxonomyCode( getTaxonomyCode() );
+ try {
+ t.setTaxonomyCode( getTaxonomyCode() );
+ }
+ catch ( final PhyloXmlDataFormatException e ) {
+ e.printStackTrace();
+ }
t.setScientificName( getScientificName() );
t.setCommonName( getCommonName() );
t.setAuthority( getAuthority() );
t.setScientificName( getScientificName() );
t.setCommonName( getCommonName() );
t.setAuthority( getAuthority() );
@@
-122,7
+127,12
@@
public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
else {
t.setIdentifier( null );
}
else {
t.setIdentifier( null );
}
- t.setRank( new String( getRank() ) );
+ try {
+ t.setRank( new String( getRank() ) );
+ }
+ catch ( final PhyloXmlDataFormatException e ) {
+ e.printStackTrace();
+ }
if ( getUris() != null ) {
t.setUris( new ArrayList<Uri>() );
for( final Uri uri : getUris() ) {
if ( getUris() != null ) {
t.setUris( new ArrayList<Uri>() );
for( final Uri uri : getUris() ) {
@@
-197,7
+207,7
@@
public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
@Override
public int hashCode() {
@Override
public int hashCode() {
- if ( getIdentifier() != null && !ForesterUtil.isEmpty( getIdentifier().getValue() ) ) {
+ if ( ( getIdentifier() != null ) && !ForesterUtil.isEmpty( getIdentifier().getValue() ) ) {
return getIdentifier().hashCode();
}
else if ( !ForesterUtil.isEmpty( getTaxonomyCode() ) ) {
return getIdentifier().hashCode();
}
else if ( !ForesterUtil.isEmpty( getTaxonomyCode() ) ) {
@@
-218,8
+228,18
@@
public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
setScientificName( "" );
setCommonName( "" );
setIdentifier( null );
setScientificName( "" );
setCommonName( "" );
setIdentifier( null );
- setRank( "" );
- setTaxonomyCode( "" );
+ try {
+ setRank( "" );
+ }
+ catch ( final PhyloXmlDataFormatException e ) {
+ e.printStackTrace();
+ }
+ try {
+ setTaxonomyCode( "" );
+ }
+ catch ( final PhyloXmlDataFormatException e ) {
+ e.printStackTrace();
+ }
setAuthority( "" );
setSynonyms( null );
setUris( null );
setAuthority( "" );
setSynonyms( null );
setUris( null );
@@
-252,10
+272,8
@@
public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
}
final Taxonomy tax = ( Taxonomy ) data;
if ( ( getIdentifier() != null ) && ( tax.getIdentifier() != null )
}
final Taxonomy tax = ( Taxonomy ) data;
if ( ( getIdentifier() != null ) && ( tax.getIdentifier() != null )
- && !ForesterUtil.isEmpty( getIdentifier().getValue() )
- && !ForesterUtil.isEmpty( tax.getIdentifier().getValue() )
-
- ) {
+ && !ForesterUtil.isEmpty( getIdentifier().getValue() )
+ && !ForesterUtil.isEmpty( tax.getIdentifier().getValue() ) ) {
return getIdentifier().isEqual( tax.getIdentifier() );
}
else if ( !ForesterUtil.isEmpty( getTaxonomyCode() ) && !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) ) {
return getIdentifier().isEqual( tax.getIdentifier() );
}
else if ( !ForesterUtil.isEmpty( getTaxonomyCode() ) && !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) ) {
@@
-292,7
+310,7
@@
public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
_identifier = identifier;
}
_identifier = identifier;
}
- public void setRank( final String rank ) {
+ public void setRank( final String rank ) throws PhyloXmlDataFormatException {
if ( !ForesterUtil.isEmpty( rank ) && !PhyloXmlUtil.TAXONOMY_RANKS_SET.contains( rank ) ) {
throw new PhyloXmlDataFormatException( "illegal rank: [" + rank + "]" );
}
if ( !ForesterUtil.isEmpty( rank ) && !PhyloXmlUtil.TAXONOMY_RANKS_SET.contains( rank ) ) {
throw new PhyloXmlDataFormatException( "illegal rank: [" + rank + "]" );
}
@@
-307,7
+325,7
@@
public class Taxonomy implements PhylogenyData, MultipleUris, Comparable<Taxonom
_synonyms = synonyms;
}
_synonyms = synonyms;
}
- public void setTaxonomyCode( final String taxonomy_code ) {
+ public void setTaxonomyCode( final String taxonomy_code ) throws PhyloXmlDataFormatException {
if ( !ForesterUtil.isEmpty( taxonomy_code )
&& !PhyloXmlUtil.TAXOMONY_CODE_PATTERN.matcher( taxonomy_code ).matches() ) {
throw new PhyloXmlDataFormatException( "illegal taxonomy code: [" + taxonomy_code + "]" );
if ( !ForesterUtil.isEmpty( taxonomy_code )
&& !PhyloXmlUtil.TAXOMONY_CODE_PATTERN.matcher( taxonomy_code ).matches() ) {
throw new PhyloXmlDataFormatException( "illegal taxonomy code: [" + taxonomy_code + "]" );