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
inprogress
[jalview.git]
/
forester
/
java
/
src
/
org
/
forester
/
io
/
parsers
/
SymmetricalDistanceMatrixParser.java
diff --git
a/forester/java/src/org/forester/io/parsers/SymmetricalDistanceMatrixParser.java
b/forester/java/src/org/forester/io/parsers/SymmetricalDistanceMatrixParser.java
index
991329b
..
0bdafe1
100644
(file)
--- a/
forester/java/src/org/forester/io/parsers/SymmetricalDistanceMatrixParser.java
+++ b/
forester/java/src/org/forester/io/parsers/SymmetricalDistanceMatrixParser.java
@@
-22,7
+22,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.io.parsers;
package org.forester.io.parsers;
@@
-55,7
+55,7
@@
public class SymmetricalDistanceMatrixParser {
private final static InputMatrixType INPUT_MATRIX_TYPE_DEFAULT = InputMatrixType.LOWER_TRIANGLE;
private final static String COMMENT = "#";
private final static InputMatrixType INPUT_MATRIX_TYPE_DEFAULT = InputMatrixType.LOWER_TRIANGLE;
private final static String COMMENT = "#";
- private final static String VALUE_SEPARATOR = " ";
+ private final static char VALUE_SEPARATOR = ' ';
private int _matrix_size;
private InputMatrixType _input_matrix_type;
private int _matrix_size;
private InputMatrixType _input_matrix_type;
@@
-98,7
+98,12
@@
public class SymmetricalDistanceMatrixParser {
public DistanceMatrix[] parse( final Object source ) throws IOException {
reset();
public DistanceMatrix[] parse( final Object source ) throws IOException {
reset();
- final List<BasicTable<String>> tables = BasicTableParser.parse( source, VALUE_SEPARATOR, false, COMMENT, true );
+ final List<BasicTable<String>> tables = BasicTableParser.parse( source,
+ VALUE_SEPARATOR,
+ false,
+ false,
+ COMMENT,
+ true );
final DistanceMatrix[] distance_matrices = new DistanceMatrix[ tables.size() ];
int i = 0;
for( final BasicTable<String> table : tables ) {
final DistanceMatrix[] distance_matrices = new DistanceMatrix[ tables.size() ];
int i = 0;
for( final BasicTable<String> table : tables ) {
@@
-137,7
+142,7
@@
public class SymmetricalDistanceMatrixParser {
throw new IOException( "illegal format for distance [" + table_value + "] at [" + ( col - 1 ) + ", " + row
+ "]" );
}
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<String> table ) throws IllegalArgumentException, IOException {
}
private DistanceMatrix transform( final BasicTable<String> table ) throws IllegalArgumentException, IOException {
@@
-149,7
+154,7
@@
public class SymmetricalDistanceMatrixParser {
if ( table.getNumberOfColumns() == table.getNumberOfRows() ) {
first_line_is_size = true;
}
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() + "]" );
}
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;
}
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:
distance_matrix.setIdentifier( row, table.getValue( 0, row + start_row ) );
switch ( getInputMatrixType() ) {
case LOWER_TRIANGLE: