mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 22:29:18 +01:00
Modifications to Data classes for Reference entries
This commit is contained in:
@@ -1294,12 +1294,14 @@ public class Table {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief Removes a column from the table
|
||||
*/
|
||||
public void removeColumn(String columnName) {
|
||||
removeColumn(getColumnIndex(columnName));
|
||||
}
|
||||
|
||||
|
||||
public void removeColumn(int column) {
|
||||
int newCount = columns.length - 1;
|
||||
|
||||
@@ -1331,7 +1333,10 @@ public class Table {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief To come...
|
||||
*/
|
||||
public int getColumnCount() {
|
||||
return columns.length;
|
||||
}
|
||||
@@ -1655,7 +1660,10 @@ public class Table {
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief To come...
|
||||
*/
|
||||
public int getRowCount() {
|
||||
return rowCount;
|
||||
}
|
||||
@@ -1665,7 +1673,10 @@ public class Table {
|
||||
return getRowCount() - 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief Removes all rows from a table
|
||||
*/
|
||||
public void clearRows() {
|
||||
setRowCount(0);
|
||||
}
|
||||
@@ -1702,7 +1713,10 @@ public class Table {
|
||||
rowCount = newCount;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief Adds a row to the table
|
||||
*/
|
||||
public TableRow addRow() {
|
||||
setRowCount(rowCount + 1);
|
||||
return new RowPointer(this, rowCount - 1);
|
||||
@@ -1791,7 +1805,10 @@ public class Table {
|
||||
rowCount++;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief Removes a row from the table
|
||||
*/
|
||||
public void removeRow(int row) {
|
||||
for (int col = 0; col < columns.length; col++) {
|
||||
switch (columnTypes[col]) {
|
||||
@@ -1986,7 +2003,10 @@ public class Table {
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief Gets a row from the table
|
||||
*/
|
||||
public TableRow getRow(int row) {
|
||||
return new RowPointer(this, row);
|
||||
}
|
||||
@@ -1996,6 +2016,9 @@ public class Table {
|
||||
* Note that this one iterator instance is shared by any calls to iterate
|
||||
* the rows of this table. This is very efficient, but not thread-safe.
|
||||
* If you want to iterate in a multi-threaded manner, don't use the iterator.
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief To come...
|
||||
*/
|
||||
public Iterable<TableRow> rows() {
|
||||
return new Iterable<TableRow>() {
|
||||
@@ -2751,7 +2774,10 @@ public class Table {
|
||||
setString(row, column, value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief To come...
|
||||
*/
|
||||
public String[] getStringColumn(String name) {
|
||||
int col = getColumnIndex(name);
|
||||
return (col == -1) ? null : getStringColumn(col);
|
||||
@@ -2880,7 +2906,10 @@ public class Table {
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief To come...
|
||||
*/
|
||||
public TableRow findRow(String value, int column) {
|
||||
int row = findRowIndex(value, column);
|
||||
return (row == -1) ? null : new RowPointer(this, row);
|
||||
@@ -2891,7 +2920,10 @@ public class Table {
|
||||
return findRow(value, getColumnIndex(columnName));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief To come...
|
||||
*/
|
||||
public Iterator<TableRow> findRows(String value, int column) {
|
||||
return new RowIndexIterator(this, findRowIndices(value, column));
|
||||
}
|
||||
@@ -2988,7 +3020,10 @@ public class Table {
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief To come...
|
||||
*/
|
||||
public TableRow matchRow(String regexp, int column) {
|
||||
int row = matchRowIndex(regexp, column);
|
||||
return (row == -1) ? null : new RowPointer(this, row);
|
||||
@@ -2999,7 +3034,10 @@ public class Table {
|
||||
return matchRow(regexp, getColumnIndex(columnName));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief To come...
|
||||
*/
|
||||
public Iterator<TableRow> matchRows(String value, int column) {
|
||||
return new RowIndexIterator(this, matchRowIndices(value, column));
|
||||
}
|
||||
@@ -3085,6 +3123,9 @@ public class Table {
|
||||
|
||||
/**
|
||||
* Remove any of the specified characters from the entire table.
|
||||
*
|
||||
* @webref table:method
|
||||
* @brief Remove characters from the entire table
|
||||
*/
|
||||
public void removeTokens(String tokens) {
|
||||
for (int col = 0; col < getColumnCount(); col++) {
|
||||
@@ -3129,7 +3170,10 @@ public class Table {
|
||||
|
||||
// . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
|
||||
|
||||
|
||||
/**
|
||||
* @webref table:method
|
||||
* @brief To come...
|
||||
*/
|
||||
public void trim() {
|
||||
for (int col = 0; col < getColumnCount(); col++) {
|
||||
trim(col);
|
||||
|
||||
Reference in New Issue
Block a user