|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dxfeed.model.market.OrderBookModel
public class OrderBookModel
Model for convenient Order Book management.
DXFeed feed = ...; OrderBookModel model = new OrderBookModel(); model.setFilter(OrderBookModelFilter.ALL); model.setSymbol("GOOG"); model.getBuyOrders().addListener(new ObservableListModelListener() { public void modelChanged(Change<? extends Order> change) { for (Order order : change.getSource()) System.out.println(order); System.out.println(); } }); model.attach(feed);
attached
model only from
inside of the notification invocations or from within the thread that performs
those notifications.
Listeners are invoked in the context of the corresponding DXEndpoint
executor
and the corresponding notification
is guaranteed to never be concurrent, even though it may happen from different
threads if executor is multi-threaded.
Constructor Summary | |
---|---|
OrderBookModel()
Creates new model. |
Method Summary | |
---|---|
void |
attach(DXFeed feed)
Attaches model to the specified feed. |
void |
detach(DXFeed feed)
Detaches model from the specified feed. |
ObservableListModel<Order> |
getBuyOrders()
Returns bid side (buy orders) of the order book. |
OrderBookModelFilter |
getFilter()
Returns filter for the model. |
int |
getLotSize()
Returns lot size. |
ObservableListModel<Order> |
getSellOrders()
Returns offer side (sell orders) of the order book. |
String |
getSymbol()
Returns order book symbol, or null for empty subscription. |
void |
setFilter(OrderBookModelFilter filter)
Sets the specified filter to the model. |
void |
setLotSize(int lotSize)
Sets the lot size. |
void |
setSymbol(String symbol)
Sets symbol for the order book to subscribe for. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public OrderBookModel()
OrderBookModelFilter.ALL
.
Method Detail |
---|
public OrderBookModelFilter getFilter()
OrderBookModelFilter
public void setFilter(OrderBookModelFilter filter)
filter
- model filterpublic String getSymbol()
null
for empty subscription.
public void setSymbol(String symbol)
symbol
- order book symbol.public int getLotSize()
COMPOSITE
,
REGIONAL
, and AGGREGATE
level orders.
public void setLotSize(int lotSize)
lotSize
- lot size multipliergetLotSize()
public ObservableListModel<Order> getBuyOrders()
public ObservableListModel<Order> getSellOrders()
public void attach(DXFeed feed)
feed
- feed to attach to.public void detach(DXFeed feed)
feed
- feed to detach from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |