public class OrderBook extends Object
Constructor and Description |
---|
OrderBook(OrderBookListener listener)
Create an order book.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel(long orderId,
long size)
Cancel a quantity of an order in this order book.
|
void |
enter(long orderId,
Side side,
long price,
long size)
Enter an order to this order book.
|
public OrderBook(OrderBookListener listener)
listener
- a listener for outbound events from the order bookpublic void enter(long orderId, Side side, long price, long size)
The incoming order is first matched against resting orders in this order book. This operation results in zero or more Match events.
If the remaining quantity is not zero after the matching operation, the remaining quantity is added to this order book and an Add event is triggered.
If the order identifier is known, do nothing.
orderId
- an order identifierside
- the sideprice
- the limit pricesize
- the sizepublic void cancel(long orderId, long size)
A Cancel event is triggered.
If the order identifier is unknown, do nothing.
orderId
- the order identifiersize
- the new sizeCopyright © 2017. All rights reserved.