/** * @webref table:method * @brief Finds multiple rows that match the given expression * @param value the regular expression to match * @param column ID number of the column to search */ public Iterator<TableRow> matchRowIterator(String value, int column) { return new RowIndexIterator(this, matchRowIndices(value, column)); }
/** * @webref table:method * @brief Adds a row to a table * @see Table#removeRow(int) * @see Table#clearRows() */ public TableRow addRow() { //if (rowIncrement == 0) { setRowCount(rowCount + 1); return new RowPointer(this, rowCount - 1); }
/** * @nowebref */ public TableRow addRow(Object[] columnData) { setRow(getRowCount(), columnData); return new RowPointer(this, rowCount - 1); }
/** * Return this dictionary as a String in JSON format. */ public String toJSON() { StringList temp = new StringList(); for (String item : this) { temp.append(JSONObject.quote(item)); } return "[ " + temp.join(", ") + " ]"; }
public IntDict getOrder(int column) { StringList list = new StringList(getStringColumn(column)); return list.getOrder(); }
public String[] getUnique(int column) { StringList list = new StringList(getStringColumn(column)); return list.getUnique(); }
public FloatDict getFloatDict(int keyColumn, int valueColumn) { return new FloatDict(getStringColumn(keyColumn), getFloatColumn(valueColumn)); }
public Table(Iterable<TableRow> rows) { boolean typed = false; for (TableRow row : rows) { if (!typed) { setColumnTypes(row.getColumnTypes()); } addRow(row); } }
public IntDict getIntDict(int keyColumn, int valueColumn) { return new IntDict(getStringColumn(keyColumn), getIntColumn(valueColumn)); }
public StringDict getStringDict(int keyColumn, int valueColumn) { return new StringDict(getStringColumn(keyColumn), getStringColumn(valueColumn)); }
/** * Construct a JSONObject from a source JSON text string. * This is the most commonly used JSONObject constructor. * @param source A string beginning * with <code>{</code> <small>(left brace)</small> and ending * with <code>}</code> <small>(right brace)</small>. * @exception RuntimeException If there is a syntax error in the source * string or a duplicated key. */ static public JSONObject parse(String source) { return new JSONObject(new JSONTokener(source)); }
/** * @brief Finds multiple rows that contain the given value * @param value the value to match * @param column ID number of the column to search */ public Iterator<TableRow> findRowIterator(String value, int column) { return new RowIndexIterator(this, findRowIndices(value, column)); }
public IntDict getOrder(int column) { StringList list = new StringList(getStringColumn(column)); return list.getOrder(); }
/** * @nowebref */ public TableRow addRow(Object[] columnData) { setRow(getRowCount(), columnData); return new RowPointer(this, rowCount - 1); }
public FloatDict getFloatDict(String keyColumnName, String valueColumnName) { return new FloatDict(getStringColumn(keyColumnName), getFloatColumn(valueColumnName)); }
/** * @webref table:method * @brief Adds a row to a table * @see Table#removeRow(int) * @see Table#clearRows() */ public TableRow addRow() { //if (rowIncrement == 0) { setRowCount(rowCount + 1); return new RowPointer(this, rowCount - 1); }
public StringDict getStringDict(String keyColumnName, String valueColumnName) { return new StringDict(getStringColumn(keyColumnName), getStringColumn(valueColumnName)); }
/** * @webref table:method * @brief Finds multiple rows that match the given expression * @param value the regular expression to match * @param column ID number of the column to search */ public Iterator<TableRow> matchRowIterator(String value, int column) { return new RowIndexIterator(this, matchRowIndices(value, column)); }
/** * Construct a JSONObject from a source JSON text string. * This is the most commonly used JSONObject constructor. * @param source A string beginning * with <code>{</code> <small>(left brace)</small> and ending * with <code>}</code> <small>(right brace)</small>. * @exception JSONException If there is a syntax error in the source * string or a duplicated key. */ static public JSONObject parse(String source) { return new JSONObject(new JSONTokener(source)); }
/** * @brief Finds multiple rows that contain the given value * @param value the value to match * @param column ID number of the column to search */ public Iterator<TableRow> findRowIterator(String value, int column) { return new RowIndexIterator(this, findRowIndices(value, column)); }