Assume a class
LimitOrderBook which represents a limit order book in a trading system.
To be able to represent the limit order book a data handler reads a feed which adds data to the representation of the limit order book using the following three methods:
public OrderReference add(Order order)
public boolean cancel(OrderReference orderReference)
public void execute(...)
These three methods alter the state of the limit order book. These three are more or less given, they're all needed to implement the LOB representation.
In addition to those three required "state altering" methods a typical LOB representation also provides a number of query methods that the trading models can call. One obvious example of such a method would be
What are the most important query methods a general LOB should provide? Or more specifically, in the LOB's you've built, what query methods did you include? Why?