interface IO2GEachRowListener
Brief
The interface provides the method signature to process notifications about iteration through rows of a table.
Details
The interface can be implemented only when your application uses the O2GTableManager.
Prerequisites
You must specify that your session uses the table manager before a login. For example,
mSession.useTableManager(O2GTableManagerMode.YES, null);
After the successful login, you must obtain an instance of the O2GTableManager class. For example,
O2GTableManager tableManager = mSession.getTableManager();
Before processing notifications about iteration through rows of a specific table, you must obtain an instance of a class that represents the table. For example, if you need information about opened positions, write the following line:
O2GTradesTable tradesTable = (O2GTradesTable)tableManager.getTable(O2GTableType.TRADES);
For complete instructions on the table manager usage, see the How to use table manager in ForexConnect API section.
Implementation
To use the onEachRow method of the IO2GEachRowListener
interface, you must create a class that implements the interface.
For example,
public class EachRowListener implements IO2GEachRowListener { }
In your application you must create an instance of the class that implements the interface. For example,
IO2GEachRowListener eachRowListener = new EachRowListener();
This instance must be passed as an argument to the O2GTable.forEachRow method. For example, to iterate through
rows of the Trades table, write the following line:
tradesTable.forEachRow(eachRowListener);
For the interface implementation details, see the example below.
Example
Iterate through open positions [show]
Public Methods | |
Processes iteration through rows of a table. |