X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fio%2Fparsers%2FSymmetricalDistanceMatrixParser.java;h=03f66df33f14b9afa8eb371af50875ef594ba519;hb=2b1c49af616eb01a99a69daf8f703f494b1a5a7e;hp=991329be3ad8761f120c4c5aea4155b38cc00052;hpb=eee996a6476a1e3d84c07f8f690dcde3ff4b2ef5;p=jalview.git diff --git a/forester/java/src/org/forester/io/parsers/SymmetricalDistanceMatrixParser.java b/forester/java/src/org/forester/io/parsers/SymmetricalDistanceMatrixParser.java index 991329b..03f66df 100644 --- a/forester/java/src/org/forester/io/parsers/SymmetricalDistanceMatrixParser.java +++ b/forester/java/src/org/forester/io/parsers/SymmetricalDistanceMatrixParser.java @@ -98,7 +98,12 @@ public class SymmetricalDistanceMatrixParser { public DistanceMatrix[] parse( final Object source ) throws IOException { reset(); - final List> tables = BasicTableParser.parse( source, VALUE_SEPARATOR, false, COMMENT, true ); + final List> tables = BasicTableParser.parse( source, + VALUE_SEPARATOR, + false, + false, + COMMENT, + true ); final DistanceMatrix[] distance_matrices = new DistanceMatrix[ tables.size() ]; int i = 0; for( final BasicTable table : tables ) { @@ -137,7 +142,7 @@ public class SymmetricalDistanceMatrixParser { throw new IOException( "illegal format for distance [" + table_value + "] at [" + ( col - 1 ) + ", " + row + "]" ); } - distance_matrix.setValue( col - 1 + col_offset, row, d ); + distance_matrix.setValue( ( col - 1 ) + col_offset, row, d ); } private DistanceMatrix transform( final BasicTable table ) throws IllegalArgumentException, IOException { @@ -149,7 +154,7 @@ public class SymmetricalDistanceMatrixParser { if ( table.getNumberOfColumns() == table.getNumberOfRows() ) { first_line_is_size = true; } - else if ( table.getNumberOfColumns() != table.getNumberOfRows() + 1 ) { + else if ( table.getNumberOfColumns() != ( table.getNumberOfRows() + 1 ) ) { throw new IllegalArgumentException( "attempt to create distance matrix with illegal dimensions [columns: " + table.getNumberOfColumns() + ", rows: " + table.getNumberOfRows() + "]" ); } @@ -158,7 +163,7 @@ public class SymmetricalDistanceMatrixParser { if ( first_line_is_size ) { start_row = 1; } - for( int row = 0; row < table.getNumberOfRows() - start_row; row++ ) { + for( int row = 0; row < ( table.getNumberOfRows() - start_row ); row++ ) { distance_matrix.setIdentifier( row, table.getValue( 0, row + start_row ) ); switch ( getInputMatrixType() ) { case LOWER_TRIANGLE: