in progress
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Thu, 8 Dec 2011 16:03:53 +0000 (16:03 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Thu, 8 Dec 2011 16:03:53 +0000 (16:03 +0000)
forester/java/src/org/forester/application/surfacing.java
forester/java/src/org/forester/phylogeny/data/Accession.java
forester/java/src/org/forester/phylogeny/data/Identifier.java
forester/java/src/org/forester/surfacing/SurfacingUtil.java

index fee80e0..0e6ad5f 100644 (file)
@@ -233,7 +233,7 @@ public class surfacing {
     final static private String                               SEQ_EXTRACT_OPTION                                                     = "prot_extract";
     final static private char                                 SEPARATOR_FOR_INPUT_VALUES                                             = '#';
     final static private String                               PRG_VERSION                                                            = "2.210";
-    final static private String                               PRG_DATE                                                               = "2011.11.25";
+    final static private String                               PRG_DATE                                                               = "2011.11.30";
     final static private String                               E_MAIL                                                                 = "czmasek@burnham.org";
     final static private String                               WWW                                                                    = "www.phylosoft.org/forester/applications/surfacing";
     final static private boolean                              IGNORE_DUFS_DEFAULT                                                    = true;
index c2b4435..3a565ab 100644 (file)
@@ -32,14 +32,21 @@ import org.forester.io.parsers.nhx.NHXtags;
 import org.forester.io.parsers.phyloxml.PhyloXmlMapping;
 import org.forester.util.ForesterUtil;
 
-public class Accession implements PhylogenyData {
+public final class Accession implements PhylogenyData {
 
-    final String _value;
-    final String _source;
+    final private String _value;
+    final private String _source;
+    final private String _value_source;
 
     public Accession( final String value, final String source ) {
         _value = value;
         _source = source;
+        if ( source != null ) {
+            _value_source = value + source;
+        }
+        else {
+            _value_source = value;
+        }
     }
 
     @Override
@@ -91,10 +98,10 @@ public class Accession implements PhylogenyData {
 
     @Override
     public int hashCode() {
-        if ( getSource() != null ) {
-            return ( getSource() + getValue() ).hashCode();
-        }
-        return getValue().hashCode();
+        //if ( getSource() != null ) {
+        //    return ( getSource() + getValue() ).hashCode();
+        // }
+        return _value_source.hashCode();
     }
 
     @Override
index 62dc722..cd58bad 100644 (file)
@@ -32,24 +32,33 @@ import org.forester.io.parsers.nhx.NHXtags;
 import org.forester.io.parsers.phyloxml.PhyloXmlMapping;
 import org.forester.util.ForesterUtil;
 
-public class Identifier implements PhylogenyData {
+public final class Identifier implements PhylogenyData {
 
-    final String _value;
-    final String _provider;
+    final private String _value;
+    final private String _provider;
+    final private String _value_provider;
 
     public Identifier() {
         _value = "";
         _provider = "";
+        _value_provider = "";
     }
 
     public Identifier( final String value ) {
         _value = value;
         _provider = "";
+        _value_provider = value;
     }
 
     public Identifier( final String value, final String provider ) {
         _value = value;
         _provider = provider;
+        if ( provider != null ) {
+            _value_provider = value + provider;
+        }
+        else {
+            _value_provider = value;
+        }
     }
 
     @Override
@@ -101,10 +110,7 @@ public class Identifier implements PhylogenyData {
 
     @Override
     public int hashCode() {
-        if ( getProvider() != null ) {
-            return ( getProvider() + getValue() ).hashCode();
-        }
-        return getValue().hashCode();
+        return _value_provider.hashCode();
     }
 
     @Override
index 862621a..d3e8c0a 100644 (file)
@@ -241,7 +241,7 @@ public final class SurfacingUtil {
             final SortedMap<String, Integer> lca_ancestor_species_counts = new TreeMap<String, Integer>();
             for( final String dc : more_than_once ) {
                 final List<PhylogenyNode> nodes = new ArrayList<PhylogenyNode>();
-                for( final PhylogenyNodeIterator it = local_phylogeny_l.iteratorPostorder(); it.hasNext(); ) {
+                for( final PhylogenyNodeIterator it = local_phylogeny_l.iteratorExternalForward(); it.hasNext(); ) {
                     final PhylogenyNode n = it.next();
                     if ( n.getNodeData().getBinaryCharacters().getGainedCharacters().contains( dc ) ) {
                         nodes.add( n );