public final class OrderBook extends Object
Constructor and Description |
---|
OrderBook(Date timeStamp,
List<LimitOrder> asks,
List<LimitOrder> bids)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
List<LimitOrder> |
getAsks() |
List<LimitOrder> |
getBids() |
List<LimitOrder> |
getOrders(Order.OrderType type) |
Date |
getTimeStamp() |
int |
hashCode() |
boolean |
ordersEqual(OrderBook ob)
Identical to
equals method except that this ignores different timestamps. |
String |
toString() |
void |
update(LimitOrder limitOrder)
Given a new LimitOrder, it will replace and old matching limit order in the orderbook or simply get added.
|
void |
update(OrderBookUpdate orderBookUpdate)
Given an OrderBookUpdate, it will replace and old matching limit order in the orderbook or simply get added.
|
public OrderBook(Date timeStamp, List<LimitOrder> asks, List<LimitOrder> bids)
timeStamp
- - the timestamp of the orderbook according to the exchange's server, null if not providedasks
- The ASK ordersbids
- The BID orderspublic Date getTimeStamp()
public List<LimitOrder> getAsks()
public List<LimitOrder> getBids()
public List<LimitOrder> getOrders(Order.OrderType type)
public void update(LimitOrder limitOrder)
limitOrder
- the new LimitOrderpublic void update(OrderBookUpdate orderBookUpdate)
orderBookUpdate
- the new OrderBookUpdatepublic boolean ordersEqual(OrderBook ob)
equals
method except that this ignores different timestamps. In other words, this version of equals returns
true if the order internal to the OrderBooks are equal but their timestamps are unequal. It returns false if false if any order between the two
are different.ob
- Copyright © 2012–2017 Xeiam, LLC. All rights reserved.