changed Mainframe from JFrame to JInternalFrame
[jalview.git] / forester / java / src / org / forester / util / BasicTableParser.java
index aaa5781..8d7f887 100644 (file)
@@ -38,13 +38,13 @@ public class BasicTableParser {
     private BasicTableParser() {
     }
 
-    public static BasicTable<String> parse( final Object source, final String column_delimiter ) throws IOException {
+    public static BasicTable<String> parse( final Object source, final char column_delimiter ) throws IOException {
         return BasicTableParser.parse( source, column_delimiter, false, false, START_OF_COMMENT_LINE_DEFAULT, false )
                 .get( 0 );
     }
 
     public static BasicTable<String> parse( final Object source,
-                                            final String column_delimiter,
+                                            final char column_delimiter,
                                             final boolean use_first_separator_only,
                                             final boolean use_last_separator_only ) throws IOException {
         return BasicTableParser.parse( source,
@@ -56,12 +56,12 @@ public class BasicTableParser {
     }
 
     public static List<BasicTable<String>> parse( final Object source,
-                                                  final String column_delimiter,
+                                                  final char column_delimiter,
                                                   final boolean use_first_separator_only,
                                                   final boolean use_last_separator_only,
                                                   final String start_of_comment_line,
                                                   final boolean tables_separated_by_single_string_line )
-            throws IOException {
+                                                          throws IOException {
         if ( use_first_separator_only && use_last_separator_only ) {
             throw new IllegalArgumentException();
         }
@@ -77,7 +77,7 @@ public class BasicTableParser {
             if ( !ForesterUtil.isEmpty( line )
                     && ( ( ( line.charAt( 0 ) == '"' ) && ( line.charAt( line.length() - 1 ) == '"' ) && ( ForesterUtil
                             .countChars( line, '"' ) == 2 ) ) || ( ( line.charAt( 0 ) == '\'' )
-                            && ( line.charAt( line.length() - 1 ) == '\'' ) && ( ForesterUtil.countChars( line, '\'' ) == 2 ) ) ) ) {
+                                    && ( line.charAt( line.length() - 1 ) == '\'' ) && ( ForesterUtil.countChars( line, '\'' ) == 2 ) ) ) ) {
                 line = line.substring( 1, line.length() - 1 ).trim();
             }
             if ( saw_first_table
@@ -93,7 +93,7 @@ public class BasicTableParser {
                     && ( !use_start_of_comment_line || !line.startsWith( start_of_comment_line ) ) ) {
                 saw_first_table = true;
                 if ( use_last_separator_only ) {
-                    final String e[] = line.split( column_delimiter );
+                    final String e[] = line.split( column_delimiter + "" );
                     final StringBuffer rest = new StringBuffer();
                     for( int i = 0; i < ( e.length - 1 ); ++i ) {
                         rest.append( e[ i ].trim() );
@@ -102,7 +102,7 @@ public class BasicTableParser {
                     table.setValue( 1, row, e[ e.length - 1 ] );
                 }
                 else {
-                    final StringTokenizer st = new StringTokenizer( line, column_delimiter );
+                    final StringTokenizer st = new StringTokenizer( line, column_delimiter + "" );
                     int col = 0;
                     if ( st.hasMoreTokens() ) {
                         table.setValue( col++, row, st.nextToken().trim() );