OrderBook
Package: velox.api.layer1.layers.utils
Type: Class
Inheritance: java.lang.Object รขโ โ OrderBook
Fieldsโ
NONEโ
public static final int NONE
bidMapโ
protected TreeMap<Integer, Long> bidMap
askMapโ
protected TreeMap<Integer, Long> askMap
Constructorsโ
OrderBookโ
public OrderBook()
OrderBookโ
public OrderBook(OrderBook orderBook)
Methodsโ
onUpdateโ
public void onUpdate(boolean isBid, int price, long size)
onUpdateโ
public void onUpdate(DepthAggregationEvent depthAggregationEvent)
updateMapโ
protected void updateMap(TreeMap<Integer, Long> updatedMap, int price, long size)
getBestBidPriceOrNoneโ
public int getBestBidPriceOrNone()
getBestAskPriceOrNoneโ
public int getBestAskPriceOrNone()
getMidPriceOrNanโ
public double getMidPriceOrNan()
getFirstKeyOrNoneโ
public int getFirstKeyOrNone(TreeMap<Integer, Long> map)
getFirstValueOrNoneโ
public long getFirstValueOrNone(TreeMap<Integer, Long> map)
levelsโ
public Integer[] levels(boolean isBid)
getWorstBidPriceOrNoneโ
public int getWorstBidPriceOrNone()
getWorstAskPriceOrNoneโ
public int getWorstAskPriceOrNone()
getLastKeyOrNoneโ
public int getLastKeyOrNone(TreeMap<Integer, Long> map)
levelsโ
public Map<Integer, Long> levels(boolean isBid, int from, int to)
levelsโ
public Map<Integer, Long> levels(boolean isBid, int from, boolean fromInclusive, int to, boolean toInclusive)
getSizeForโ
public long getSizeFor(boolean isBid, int price)
getSizeForโ
public long getSizeFor(boolean isBid, int price, long defaultSize)
clearโ
public void clear()
getBidMapโ
public TreeMap<Integer, Long> getBidMap()
Beware: changing this map will break order book
getAskMapโ
public TreeMap<Integer, Long> getAskMap()
Beware: changing this map will break order book
isEmptyโ
public boolean isEmpty()
Check if order book is empty
Returns: true if both sides of the book are empty, false otherwise
toStringโ
public String toString()
Overrides: toString in class Object