From: cmzmasek@gmail.com Date: Fri, 27 Sep 2013 22:42:10 +0000 (+0000) Subject: Integer -> Long X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=9be15466ab635bf516293647465536e89fc291c0;p=jalview.git Integer -> Long --- diff --git a/forester_applications/src/org/forester/applications/get_distances.java b/forester_applications/src/org/forester/applications/get_distances.java index 624493f..62cb1b1 100644 --- a/forester_applications/src/org/forester/applications/get_distances.java +++ b/forester_applications/src/org/forester/applications/get_distances.java @@ -73,8 +73,8 @@ public class get_distances { if ( st.countTokens() < 2 ) { continue; } - final double d = PhylogenyMethods.getInstance().calculateDistance( p.getNode( st.nextToken() ), - p.getNode( st.nextToken() ) ); + final double d = PhylogenyMethods.calculateDistance( p.getNode( st.nextToken() ), + p.getNode( st.nextToken() ) ); out.write( line + " " + d ); out.newLine(); } diff --git a/forester_applications/src/org/forester/applications/get_shared_chars.java b/forester_applications/src/org/forester/applications/get_shared_chars.java index 8496451..6f50cde 100644 --- a/forester_applications/src/org/forester/applications/get_shared_chars.java +++ b/forester_applications/src/org/forester/applications/get_shared_chars.java @@ -63,7 +63,7 @@ public class get_shared_chars { System.err.println( e + "\nCould not read " + infile + "\n" ); System.exit( -1 ); } - final SortedSet outside_external_ids = getAllExternalDescendantsNodeIds( phy.getRoot() ); + final SortedSet outside_external_ids = getAllExternalDescendantsNodeIds( phy.getRoot() ); final SortedSet all_chars = getAllExternalPresentAndGainedCharacters( phy.getRoot() ); System.out.println( "Sum of all external characters:\t" + all_chars.size() ); final SortedSet all_shared_chars = new TreeSet(); @@ -84,7 +84,7 @@ public class get_shared_chars { } final SortedSet outside_chars = new TreeSet(); System.out.println( "All shared characters\t" + all_shared_chars.size() ); - for( final Integer id : outside_external_ids ) { + for( final Long id : outside_external_ids ) { outside_chars.addAll( getAllExternalPresentAndGainedCharacters( phy.getNode( id ) ) ); } final SortedSet unique_shared_chars = copy( all_shared_chars ); @@ -105,8 +105,8 @@ public class get_shared_chars { return copy; } - private static SortedSet getAllExternalDescendantsNodeIds( final PhylogenyNode node ) { - final SortedSet ids = new TreeSet(); + private static SortedSet getAllExternalDescendantsNodeIds( final PhylogenyNode node ) { + final SortedSet ids = new TreeSet(); final List descs = node.getAllExternalDescendants(); for( final PhylogenyNode desc : descs ) { ids.add( desc.getId() ); diff --git a/forester_applications/src/org/forester/applications/get_subtree_specific_chars.java b/forester_applications/src/org/forester/applications/get_subtree_specific_chars.java index 2163927..9269d42 100644 --- a/forester_applications/src/org/forester/applications/get_subtree_specific_chars.java +++ b/forester_applications/src/org/forester/applications/get_subtree_specific_chars.java @@ -65,7 +65,7 @@ public class get_subtree_specific_chars { System.err.println( e + "\nCould not read " + infile + "\n" ); System.exit( -1 ); } - final SortedSet all_external_ids = getAllExternalDescendantsNodeIds( phy.getRoot() ); + final SortedSet all_external_ids = getAllExternalDescendantsNodeIds( phy.getRoot() ); final SortedSet all_chars = getAllExternalPresentAndGainedCharacters( phy.getRoot() ); System.out.println( "Sum of all external characters:\t" + all_chars.size() ); System.out.println(); @@ -85,11 +85,11 @@ public class get_subtree_specific_chars { } // System.out.println( ":" ); System.out.print( "\t" ); - final SortedSet external_ids = getAllExternalDescendantsNodeIds( node ); - final SortedSet not_external_ids = copy( all_external_ids ); + final SortedSet external_ids = getAllExternalDescendantsNodeIds( node ); + final SortedSet not_external_ids = copy( all_external_ids ); not_external_ids.removeAll( external_ids ); final SortedSet not_node_chars = new TreeSet(); - for( final Integer id : not_external_ids ) { + for( final Long id : not_external_ids ) { not_node_chars.addAll( getAllExternalPresentAndGainedCharacters( phy.getNode( id ) ) ); } final SortedSet node_chars = getAllExternalPresentAndGainedCharacters( node ); @@ -101,7 +101,7 @@ public class get_subtree_specific_chars { } else { boolean found = true; - for( final int external_id : external_ids ) { + for( final Long external_id : external_ids ) { if ( !phy.getNode( external_id ).getNodeData().getBinaryCharacters() .getGainedCharacters().contains( node_char ) && !phy.getNode( external_id ).getNodeData().getBinaryCharacters() @@ -133,16 +133,16 @@ public class get_subtree_specific_chars { } } - private static SortedSet copy( final SortedSet set ) { - final SortedSet copy = new TreeSet(); - for( final Integer i : set ) { + private static SortedSet copy( final SortedSet set ) { + final SortedSet copy = new TreeSet(); + for( final Long i : set ) { copy.add( i ); } return copy; } - private static SortedSet getAllExternalDescendantsNodeIds( final PhylogenyNode node ) { - final SortedSet ids = new TreeSet(); + private static SortedSet getAllExternalDescendantsNodeIds( final PhylogenyNode node ) { + final SortedSet ids = new TreeSet(); final List descs = node.getAllExternalDescendants(); for( final PhylogenyNode desc : descs ) { ids.add( desc.getId() );