@@ -185,7 +185,7 @@ public Table(ResultSet rs) {
185185 while (rs .next ()) {
186186 for (int col = 0 ; col < columnCount ; col ++) {
187187 switch (columnTypes [col ]) {
188- case STRING : set (row , col , rs .getString (col +1 )); break ;
188+ case STRING : setString (row , col , rs .getString (col +1 )); break ;
189189 case INT : setInt (row , col , rs .getInt (col +1 )); break ;
190190 case LONG : setLong (row , col , rs .getLong (col +1 )); break ;
191191 case FLOAT : setFloat (row , col , rs .getFloat (col +1 )); break ;
@@ -444,19 +444,19 @@ public void parseAwfulCSV(BufferedReader reader) throws IOException {
444444 if (reader .read () != '\n' ) {
445445 reader .reset ();
446446 }
447- set (row , col , new String (c , 0 , count ));
447+ setString (row , col , new String (c , 0 , count ));
448448 count = 0 ;
449449 row ++;
450450 col = 0 ;
451451
452452 } else if (ch == '\n' ) {
453- set (row , col , new String (c , 0 , count ));
453+ setString (row , col , new String (c , 0 , count ));
454454 count = 0 ;
455455 row ++;
456456 col = 0 ;
457457
458458 } else if (ch == ',' ) {
459- set (row , col , new String (c , 0 , count ));
459+ setString (row , col , new String (c , 0 , count ));
460460 count = 0 ;
461461 // starting a new column, make sure we have room
462462 col ++;
@@ -472,7 +472,7 @@ public void parseAwfulCSV(BufferedReader reader) throws IOException {
472472 }
473473 // catch any leftovers
474474 if (count > 0 ) {
475- set (row , col , new String (c , 0 , count ));
475+ setString (row , col , new String (c , 0 , count ));
476476 }
477477 }
478478
@@ -565,7 +565,7 @@ public void writeTSV(PrintWriter writer) {
565565 if (col != 0 ) {
566566 writer .print ('\t' );
567567 }
568- String entry = get (row , col );
568+ String entry = getString (row , col );
569569 // just write null entries as blanks, rather than spewing 'null'
570570 // all over the spreadsheet file.
571571 if (entry != null ) {
@@ -595,7 +595,7 @@ public void writeCSV(PrintWriter writer) {
595595 if (col != 0 ) {
596596 writer .print (',' );
597597 }
598- String entry = get (row , col );
598+ String entry = getString (row , col );
599599 // just write null entries as blanks, rather than spewing 'null'
600600 // all over the spreadsheet file.
601601 if (entry != null ) {
@@ -652,7 +652,7 @@ public void writeHTML(PrintWriter writer) {
652652 for (int row = 0 ; row < getRowCount (); row ++) {
653653 writer .println (" <tr>" );
654654 for (int col = 0 ; col < getColumnCount (); col ++) {
655- String entry = get (row , col );
655+ String entry = getString (row , col );
656656 writer .print (" <td>" );
657657 writeEntryHTML (writer , entry );
658658// String clean = (entry == null) ? "" : HTMLFairy.encodeEntities(entry);
@@ -865,7 +865,7 @@ protected void setColumnType(int column, int newType) {
865865 case INT : {
866866 int [] intData = new int [rowCount ];
867867 for (int row = 0 ; row < rowCount ; row ++) {
868- String s = get (row , column );
868+ String s = getString (row , column );
869869 intData [row ] = PApplet .parseInt (s , missingInt );
870870 }
871871 columns [column ] = intData ;
@@ -874,7 +874,7 @@ protected void setColumnType(int column, int newType) {
874874 case LONG : {
875875 long [] longData = new long [rowCount ];
876876 for (int row = 0 ; row < rowCount ; row ++) {
877- String s = get (row , column );
877+ String s = getString (row , column );
878878 try {
879879 longData [row ] = Long .parseLong (s );
880880 } catch (NumberFormatException nfe ) {
@@ -887,7 +887,7 @@ protected void setColumnType(int column, int newType) {
887887 case FLOAT : {
888888 float [] floatData = new float [rowCount ];
889889 for (int row = 0 ; row < rowCount ; row ++) {
890- String s = get (row , column );
890+ String s = getString (row , column );
891891 floatData [row ] = PApplet .parseFloat (s , missingFloat );
892892 }
893893 columns [column ] = floatData ;
@@ -896,7 +896,7 @@ protected void setColumnType(int column, int newType) {
896896 case DOUBLE : {
897897 double [] doubleData = new double [rowCount ];
898898 for (int row = 0 ; row < rowCount ; row ++) {
899- String s = get (row , column );
899+ String s = getString (row , column );
900900 try {
901901 doubleData [row ] = Double .parseDouble (s );
902902 } catch (NumberFormatException nfe ) {
@@ -910,7 +910,7 @@ protected void setColumnType(int column, int newType) {
910910 if (columnTypes [column ] != STRING ) {
911911 String [] stringData = new String [rowCount ];
912912 for (int row = 0 ; row < rowCount ; row ++) {
913- stringData [row ] = get (row , column );
913+ stringData [row ] = getString (row , column );
914914 }
915915 columns [column ] = stringData ;
916916 }
@@ -920,7 +920,7 @@ protected void setColumnType(int column, int newType) {
920920 int [] indexData = new int [rowCount ];
921921 HashMapBlows categories = new HashMapBlows ();
922922 for (int row = 0 ; row < rowCount ; row ++) {
923- String s = get (row , column );
923+ String s = getString (row , column );
924924 indexData [row ] = categories .index (s );
925925 }
926926 columnCategories [column ] = categories ;
@@ -955,7 +955,7 @@ public void setColumnTypes(Table dictionary) {
955955 setColumnTitles (dictionary .getStringColumn (0 ));
956956 if (dictionary .getColumnCount () > 1 ) {
957957 for (int i = 0 ; i < dictionary .getRowCount (); i ++) {
958- setColumnType (i , dictionary .get (i , 1 ));
958+ setColumnType (i , dictionary .getString (i , 1 ));
959959 }
960960 }
961961 }
@@ -1391,12 +1391,12 @@ public Iterator<TableRow> createIterator() {
13911391 class RowIterator implements Iterator <TableRow > {
13921392 int row ;
13931393 TableRow tableRow = new TableRow () {
1394- public String get (int column ) {
1395- return Table .this .get (row , column );
1394+ public String getString (int column ) {
1395+ return Table .this .getString (row , column );
13961396 }
13971397
1398- public String get (String columnName ) {
1399- return Table .this .get (row , columnName );
1398+ public String getString (String columnName ) {
1399+ return Table .this .getString (row , columnName );
14001400 }
14011401
14021402 public int getInt (int column ) {
@@ -1543,15 +1543,15 @@ public long getLong(String columnName) {
15431543 }
15441544 }
15451545
1546- public String get (int column ) {
1546+ public String getString (int column ) {
15471547 try {
15481548 return rs .getString (column );
15491549 } catch (SQLException e ) {
15501550 throw new RuntimeException (e );
15511551 }
15521552 }
15531553
1554- public String get (String columnName ) {
1554+ public String getString (String columnName ) {
15551555 try {
15561556 return rs .getString (columnName );
15571557 } catch (SQLException e ) {
@@ -1577,7 +1577,7 @@ public int getInt(int row, int column) {
15771577 int [] intData = (int []) columns [column ];
15781578 return intData [row ];
15791579 }
1580- String str = get (row , column );
1580+ String str = getString (row , column );
15811581 return (str == null || str .equals (missingString )) ?
15821582 missingInt : PApplet .parseInt (str , missingInt );
15831583 }
@@ -1595,7 +1595,7 @@ public void setMissingInt(int value) {
15951595
15961596 public void setInt (int row , int column , int what ) {
15971597 if (columnTypes [column ] == STRING ) {
1598- set (row , column , String .valueOf (what ));
1598+ setString (row , column , String .valueOf (what ));
15991599
16001600 } else {
16011601 checkSize (row , column );
@@ -1641,7 +1641,7 @@ public long getLong(int row, int column) {
16411641 long [] longData = (long []) columns [column ];
16421642 return longData [row ];
16431643 }
1644- String str = get (row , column );
1644+ String str = getString (row , column );
16451645 if (str == null || str .equals (missingString )) {
16461646 return missingLong ;
16471647 }
@@ -1665,7 +1665,7 @@ public void setMissingLong(long value) {
16651665
16661666 public void setLong (int row , int column , long what ) {
16671667 if (columnTypes [column ] == STRING ) {
1668- set (row , column , String .valueOf (what ));
1668+ setString (row , column , String .valueOf (what ));
16691669
16701670 } else {
16711671 checkSize (row , column );
@@ -1716,7 +1716,7 @@ public float getFloat(int row, int column) {
17161716 float [] floatData = (float []) columns [column ];
17171717 return floatData [row ];
17181718 }
1719- String str = get (row , column );
1719+ String str = getString (row , column );
17201720 if (str == null || str .equals (missingString )) {
17211721 return missingFloat ;
17221722 }
@@ -1736,7 +1736,7 @@ public void setMissingFloat(float value) {
17361736
17371737 public void setFloat (int row , int column , float what ) {
17381738 if (columnTypes [column ] == STRING ) {
1739- set (row , column , String .valueOf (what ));
1739+ setString (row , column , String .valueOf (what ));
17401740
17411741 } else {
17421742 checkSize (row , column );
@@ -1782,7 +1782,7 @@ public double getDouble(int row, int column) {
17821782 double [] doubleData = (double []) columns [column ];
17831783 return doubleData [row ];
17841784 }
1785- String str = get (row , column );
1785+ String str = getString (row , column );
17861786 if (str == null || str .equals (missingString )) {
17871787 return missingDouble ;
17881788 }
@@ -1806,7 +1806,7 @@ public void setMissingDouble(double value) {
18061806
18071807 public void setDouble (int row , int column , double what ) {
18081808 if (columnTypes [column ] == STRING ) {
1809- set (row , column , String .valueOf (what ));
1809+ setString (row , column , String .valueOf (what ));
18101810
18111811 } else {
18121812 checkSize (row , column );
@@ -1908,7 +1908,7 @@ public double[] getDoubleRow(int row) {
19081908 * @param col
19091909 * @return
19101910 */
1911- public String get (int row , int col ) {
1911+ public String getString (int row , int col ) {
19121912 checkBounds (row , col );
19131913 if (columnTypes [col ] == STRING ) {
19141914 String [] stringData = (String []) columns [col ];
@@ -1922,8 +1922,8 @@ public String get(int row, int col) {
19221922 }
19231923
19241924
1925- public String get (int row , String columnName ) {
1926- return get (row , getColumnIndex (columnName ));
1925+ public String getString (int row , String columnName ) {
1926+ return getString (row , getColumnIndex (columnName ));
19271927 }
19281928
19291929
@@ -1932,7 +1932,7 @@ public void setMissingString(String value) {
19321932 }
19331933
19341934
1935- public void set (int row , int column , String what ) {
1935+ public void setString (int row , int column , String what ) {
19361936 checkSize (row , column );
19371937 if (columnTypes [column ] != STRING ) {
19381938 throw new IllegalArgumentException ("Column " + column + " is not a String column." );
@@ -1942,9 +1942,9 @@ public void set(int row, int column, String what) {
19421942 }
19431943
19441944
1945- public void set (int row , String columnName , String what ) {
1945+ public void setString (int row , String columnName , String what ) {
19461946 int column = checkColumnIndex (columnName );
1947- set (row , column , what );
1947+ setString (row , column , what );
19481948 }
19491949
19501950
@@ -1957,7 +1957,7 @@ public String[] getStringColumn(String name) {
19571957 public String [] getStringColumn (int col ) {
19581958 String [] outgoing = new String [rowCount ];
19591959 for (int i = 0 ; i < rowCount ; i ++) {
1960- outgoing [i ] = get (i , col );
1960+ outgoing [i ] = getString (i , col );
19611961 }
19621962 return outgoing ;
19631963 }
@@ -1966,7 +1966,7 @@ public String[] getStringColumn(int col) {
19661966 public String [] getStringRow (int row ) {
19671967 String [] outgoing = new String [columns .length ];
19681968 for (int col = 0 ; col < columns .length ; col ++) {
1969- outgoing [col ] = get (row , col );
1969+ outgoing [col ] = getString (row , col );
19701970 }
19711971 return outgoing ;
19721972 }
@@ -2060,7 +2060,7 @@ public void removeTokens(String tokens) {
20602060 */
20612061 public void removeTokens (String tokens , int column ) {
20622062 for (int row = 0 ; row < rowCount ; row ++) {
2063- String s = get (row , column );
2063+ String s = getString (row , column );
20642064 if (s != null ) {
20652065 char [] c = s .toCharArray ();
20662066 int index = 0 ;
@@ -2073,7 +2073,7 @@ public void removeTokens(String tokens, int column) {
20732073 }
20742074 }
20752075 if (index != c .length ) {
2076- set (row , column , new String (c , 0 , index ));
2076+ setString (row , column , new String (c , 0 , index ));
20772077 }
20782078 }
20792079 }
@@ -2117,7 +2117,7 @@ public int findRow(String what, int column) {
21172117 }
21182118 } else { // less efficient, includes conversion as necessary
21192119 for (int row = 0 ; row < rowCount ; row ++) {
2120- String str = get (row , column );
2120+ String str = getString (row , column );
21212121 if (str == null ) {
21222122 if (what == null ) {
21232123 return row ;
@@ -2169,7 +2169,7 @@ public int[] findRows(String what, int column) {
21692169 }
21702170 } else { // less efficient, includes conversion as necessary
21712171 for (int row = 0 ; row < rowCount ; row ++) {
2172- String str = get (row , column );
2172+ String str = getString (row , column );
21732173 if (str == null ) {
21742174 if (what == null ) {
21752175 outgoing [count ++] = row ;
@@ -2214,7 +2214,7 @@ public int matchRow(String regexp, int column) {
22142214 }
22152215 } else { // less efficient, includes conversion as necessary
22162216 for (int row = 0 ; row < rowCount ; row ++) {
2217- String str = get (row , column );
2217+ String str = getString (row , column );
22182218 if (str != null &&
22192219 PApplet .match (str , regexp ) != null ) {
22202220 return row ;
@@ -2256,7 +2256,7 @@ public int[] matchRows(String regexp, int column) {
22562256 }
22572257 } else { // less efficient, includes conversion as necessary
22582258 for (int row = 0 ; row < rowCount ; row ++) {
2259- String str = get (row , column );
2259+ String str = getString (row , column );
22602260 if (str != null &&
22612261 PApplet .match (str , regexp ) != null ) {
22622262 outgoing [count ++] = row ;
@@ -2359,7 +2359,7 @@ public Table createSubset(int[] rowSubset) {
23592359 int row = rowSubset [i ];
23602360 for (int col = 0 ; col < columns .length ; col ++) {
23612361 switch (columnTypes [col ]) {
2362- case STRING : newbie .set (i , col , get (row , col )); break ;
2362+ case STRING : newbie .setString (i , col , getString (row , col )); break ;
23632363 case INT : newbie .setInt (i , col , getInt (row , col )); break ;
23642364 case LONG : newbie .setLong (i , col , getLong (row , col )); break ;
23652365 case FLOAT : newbie .setFloat (i , col , getFloat (row , col )); break ;
@@ -2466,7 +2466,7 @@ public String[] getUnique(String column) {
24662466 public String [] getUnique (int column ) {
24672467 HashMapSucks found = new HashMapSucks ();
24682468 for (int row = 0 ; row < getRowCount (); row ++) {
2469- found .check (get (row , column ));
2469+ found .check (getString (row , column ));
24702470 }
24712471 String [] outgoing = new String [found .size ()];
24722472 found .keySet ().toArray (outgoing );
@@ -2482,7 +2482,7 @@ public HashMap<String,Integer> getUniqueCount(String columnName) {
24822482 public HashMap <String ,Integer > getUniqueCount (int column ) {
24832483 HashMapSucks outgoing = new HashMapSucks ();
24842484 for (int row = 0 ; row < rowCount ; row ++) {
2485- String entry = get (row , column );
2485+ String entry = getString (row , column );
24862486 if (entry != null ) {
24872487 outgoing .increment (entry );
24882488 }
@@ -2500,7 +2500,7 @@ public HashMap<String,Integer> getUniqueCount(int column) {
25002500 public HashMap <String ,Integer > getRowLookup (int col ) {
25012501 HashMap <String ,Integer > outgoing = new HashMap <String , Integer >();
25022502 for (int row = 0 ; row < getRowCount (); row ++) {
2503- outgoing .put (get (row , col ), row );
2503+ outgoing .put (getString (row , col ), row );
25042504 }
25052505 return outgoing ;
25062506 }
0 commit comments