System.err.println( e + "\nCould not read " + infile + "\n" );
System.exit( -1 );
}
- final SortedSet<Integer> outside_external_ids = getAllExternalDescendantsNodeIds( phy.getRoot() );
+ final SortedSet<Long> outside_external_ids = getAllExternalDescendantsNodeIds( phy.getRoot() );
final SortedSet<String> all_chars = getAllExternalPresentAndGainedCharacters( phy.getRoot() );
System.out.println( "Sum of all external characters:\t" + all_chars.size() );
final SortedSet<String> all_shared_chars = new TreeSet<String>();
}
final SortedSet<String> outside_chars = new TreeSet<String>();
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<String> unique_shared_chars = copy( all_shared_chars );
return copy;
}
- private static SortedSet<Integer> getAllExternalDescendantsNodeIds( final PhylogenyNode node ) {
- final SortedSet<Integer> ids = new TreeSet<Integer>();
+ private static SortedSet<Long> getAllExternalDescendantsNodeIds( final PhylogenyNode node ) {
+ final SortedSet<Long> ids = new TreeSet<Long>();
final List<PhylogenyNode> descs = node.getAllExternalDescendants();
for( final PhylogenyNode desc : descs ) {
ids.add( desc.getId() );
System.err.println( e + "\nCould not read " + infile + "\n" );
System.exit( -1 );
}
- final SortedSet<Integer> all_external_ids = getAllExternalDescendantsNodeIds( phy.getRoot() );
+ final SortedSet<Long> all_external_ids = getAllExternalDescendantsNodeIds( phy.getRoot() );
final SortedSet<String> all_chars = getAllExternalPresentAndGainedCharacters( phy.getRoot() );
System.out.println( "Sum of all external characters:\t" + all_chars.size() );
System.out.println();
}
// System.out.println( ":" );
System.out.print( "\t" );
- final SortedSet<Integer> external_ids = getAllExternalDescendantsNodeIds( node );
- final SortedSet<Integer> not_external_ids = copy( all_external_ids );
+ final SortedSet<Long> external_ids = getAllExternalDescendantsNodeIds( node );
+ final SortedSet<Long> not_external_ids = copy( all_external_ids );
not_external_ids.removeAll( external_ids );
final SortedSet<String> not_node_chars = new TreeSet<String>();
- for( final Integer id : not_external_ids ) {
+ for( final Long id : not_external_ids ) {
not_node_chars.addAll( getAllExternalPresentAndGainedCharacters( phy.getNode( id ) ) );
}
final SortedSet<String> node_chars = getAllExternalPresentAndGainedCharacters( node );
}
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()
}
}
- private static SortedSet<Integer> copy( final SortedSet<Integer> set ) {
- final SortedSet<Integer> copy = new TreeSet<Integer>();
- for( final Integer i : set ) {
+ private static SortedSet<Long> copy( final SortedSet<Long> set ) {
+ final SortedSet<Long> copy = new TreeSet<Long>();
+ for( final Long i : set ) {
copy.add( i );
}
return copy;
}
- private static SortedSet<Integer> getAllExternalDescendantsNodeIds( final PhylogenyNode node ) {
- final SortedSet<Integer> ids = new TreeSet<Integer>();
+ private static SortedSet<Long> getAllExternalDescendantsNodeIds( final PhylogenyNode node ) {
+ final SortedSet<Long> ids = new TreeSet<Long>();
final List<PhylogenyNode> descs = node.getAllExternalDescendants();
for( final PhylogenyNode desc : descs ) {
ids.add( desc.getId() );