public method O2GAccountsTable.getNextRowByColumnValue

Brief

Gets the next row from O2GAccountsTable based on the column value.

Declaration
Java
O2GAccountTableRow  getNextRowByColumnValue (String columnId, Object columnValue, O2GTableIterator iterator)

Parameters
columnId

The name of a column in the Accounts table. For example, AccountKind.

columnValue

The value of the column specified by the columnId parameter. For example, if you want to search the Accounts table for trading accounts only, the columnId parameter value is AccountKind, the columnValue parameter value is 32.

iterator

The table iterator.

Details

If the row is not found, the method returns null.
Note: The returned row contains the current column values. The values are not automatically updated. To monitor changes, use IO2GTableListener.onChanged. The row interface is thread-safe. The returned row can be used in different threads without synchronization.

Example

Get trading accounts from the Accounts table [hide]

    O2GAccountsTable accountsTable = (O2GAccountsTable)tableManager.getTable(O2GTableType.ACCOUNTS);
    boolean found = false;
    O2GTableIterator iterator = new O2GTableIterator();
    O2GAccountTableRow account = accountsTable.getNextRowByColumnValue("AccountKind", "32", iterator);
    while (account != null) {
        found = true;
        System.out.println("AccountID: " + account.getAccountID() +
                           " Equity = " + account.getEquity() +
                           " UsableMargin = " + account.getUsableMargin());
        account = accountsTable.getNextRowByColumnValue("AccountKind", "32", iterator);
    }
    if (!found) {
        System.out.println("You don't have any trading accounts.");
    }

Declared in O2GAccountsTable

back