Package com.wombat.mamda.orderbook
Class MamdaOrderBookBasicDeltaList
- java.lang.Object
-
- com.wombat.mamda.orderbook.MamdaOrderBookBasicDeltaList
-
- Direct Known Subclasses:
MamdaOrderBookComplexDelta
public class MamdaOrderBookBasicDeltaList extends java.lang.Object
MamdaOrderBookBasicDeltaList is a class that saves information about an order book delta that involves multiple entries and/or price levels. For example, a modified order may involve a price change that means moving an entry from one price level to another. A delta list is made up of several basic deltas, which can be iterated over by methods provided in the class.
-
-
Field Summary
Fields Modifier and Type Field Description static int
MOD_SIDES_ASK
static int
MOD_SIDES_BID
static int
MOD_SIDES_BID_AND_ASK
static int
MOD_SIDES_NONE
-
Constructor Summary
Constructors Constructor Description MamdaOrderBookBasicDeltaList()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(MamdaOrderBookEntry entry, MamdaOrderBookPriceLevel level, double plDeltaSize, char plAction, char entryAction)
Add a basic delta.void
clear()
Clear the delta.void
dump()
Dump the complex update to the output stream.void
dump(java.io.OutputStream output)
Dump the complex update to the output stream.int
getModifiedSides()
Get which side(s) of the book have been modified by this complex update.MamdaOrderBook
getOrderBook()
Get the MamdaOrderBook object to which this delta belongs.long
getSize()
Return the number of simple deltas in this complex delta.java.util.Iterator
iterator()
void
setKeepBasicDeltas(boolean keep)
Set whether to actually keep the basic deltas.
-
-
-
Field Detail
-
MOD_SIDES_NONE
public static final int MOD_SIDES_NONE
- See Also:
- Constant Field Values
-
MOD_SIDES_BID
public static final int MOD_SIDES_BID
- See Also:
- Constant Field Values
-
MOD_SIDES_ASK
public static final int MOD_SIDES_ASK
- See Also:
- Constant Field Values
-
MOD_SIDES_BID_AND_ASK
public static final int MOD_SIDES_BID_AND_ASK
- See Also:
- Constant Field Values
-
-
Method Detail
-
clear
public void clear()
Clear the delta.
-
setKeepBasicDeltas
public void setKeepBasicDeltas(boolean keep)
Set whether to actually keep the basic deltas. Many applications don't need the basic deltas and will iterate over part or all of the full book (with the deltas already applied). If this is set to true and an attempt is made to iterate over the basic deltas (by calling begin() or end()) then a MamdaOrderBookException will be thrown.- Parameters:
keep
- true if to keep the basic deltas.
-
getModifiedSides
public int getModifiedSides()
Get which side(s) of the book have been modified by this complex update. This information may prevent the need for receivers of complex updates to iterate over one or other side of the book.- Returns:
- The modified side(s).
-
add
public void add(MamdaOrderBookEntry entry, MamdaOrderBookPriceLevel level, double plDeltaSize, char plAction, char entryAction)
Add a basic delta. This method adds a MamdaOrderBookBasicDelta to the list.- Parameters:
entry
- the entry.level
- the level.plDeltaSize
- the delta size.plAction
- the price level action.entryAction
- the entry action.
-
getOrderBook
public MamdaOrderBook getOrderBook()
Get the MamdaOrderBook object to which this delta belongs.- Returns:
- The order book related to this delta.
-
getSize
public long getSize()
Return the number of simple deltas in this complex delta.- Returns:
- the number of deltas.
-
dump
public void dump(java.io.OutputStream output)
Dump the complex update to the output stream.- Parameters:
output
- TheOutputStream
to write the update to.
-
dump
public void dump()
Dump the complex update to the output stream.
-
iterator
public java.util.Iterator iterator()
-
-