public method O2GOffersTable.getNextRowByColumnValue

Brief

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

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

Parameters
columnId

The name of a column in the Offers table. For example, InstrumentType.

columnValue

The value of the column specified by the columnId parameter. For example, if you want to search the Offers table for Forex instruments only, the columnId parameter value is InstrumentType, the columnValue parameter value is 1.

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 Forex instruments from the Offers table [hide]

    O2GOffersTable offersTable = (O2GOffersTable)tableManager.getTable(O2GTableType.OFFERS);
    boolean found = false;
    O2GTableIterator iterator = new O2GTableIterator();
    O2GOfferTableRow offer = offersTable.getNextRowByColumnValue("InstrumentType", "1", iterator);
    while (offer != null) {
        found = true;
        System.out.println("Instrument: " + offer.getInstrument() +
                           " Bid = " + offer.getBid() +
                           " Ask = " + offer.getAsk());
        offer = offersTable.getNextRowByColumnValue("InstrumentType", "1", iterator);
    }
    if (!found) {
        System.out.println("No Forex instruments found.");
    }

Declared in O2GOffersTable

back