com.wombat.mamda.orderbook
public class MamdaOrderBookPriceLevel extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static char |
ACTION_ADD |
static char |
ACTION_DELETE
Updated price level.
|
static char |
ACTION_UNKNOWN
Deleted price level.
|
static char |
ACTION_UPDATE
A new price level.
|
static char |
LEVEL_LIMIT
Unknown side (error).
|
static char |
LEVEL_MARKET
LIMIT order
|
static char |
LEVEL_UNKNOWN
MARKET order
|
static char |
SIDE_ASK
Bid (buy) side.
|
static char |
SIDE_BID
Unknown action (error).
|
static char |
SIDE_UNKNOWN
Ask (sell) side.
|
Constructor and Description |
---|
MamdaOrderBookPriceLevel()
Default constructor.
|
MamdaOrderBookPriceLevel(double price,
char side) |
MamdaOrderBookPriceLevel(MamdaOrderBookPriceLevel copy)
Construct a price level object which is a shallow copy of
the original.
|
Modifier and Type | Method and Description |
---|---|
void |
addEntriesFromLevel(MamdaOrderBookPriceLevel bookLevel,
MamdaOrderBookEntryFilter filter,
MamdaOrderBookBasicDeltaList delta) |
void |
addEntry(MamdaOrderBookEntry entry)
Add a new order book entry to the price level.
|
void |
assertEqual(MamdaOrderBookPriceLevel rhs)
Order book price level equality verification.
|
void |
checkNotExist(MamdaBookAtomicLevelEntry levelEntry)
If the provided levelEntry entry exists in the price level,
as a OrderBookEntry, a
MamdaOrderBookException exception is thrown. |
void |
checkNotExist(MamdaOrderBookEntry entry)
If the provided order book entry exists in the price level a
MamdaOrderBookException exception is thrown. |
void |
clear()
Clear the pricelevel
|
void |
copy(MamdaBookAtomicLevel copy)
Copy an atomic price level object which is an exact and deep copy of
the original.
|
void |
copy(MamdaBookAtomicLevelEntry copy)
Copy a price level object which is an exact and deep copy of
the original.
|
void |
copy(MamdaOrderBookPriceLevel copy)
Copy a price level object which is an exact and deep copy of
the original.
|
void |
deleteEntriesFromSource(com.wombat.mama.MamaSource source,
MamdaOrderBookBasicDeltaList delta) |
boolean |
empty()
Return whether there are no entries for this level.
|
java.util.Iterator |
entryIterator()
Returns a
java.util.Iterator for all entries within this
level. |
MamdaOrderBookEntry |
findEntry(java.lang.String id) |
MamdaOrderBookEntry |
findOrCreateEntry(java.lang.String id) |
char |
getAction()
Return the action for this price level.
|
MamdaOrderBookEntry |
getEntryAtPosition(long pos)
Return the order book entry at position "pos" in the price level.
|
double |
getNumEntries()
Return the actual number of entries for this level.
|
int |
getNumEntriesTotal() |
char |
getOrderType() |
com.wombat.mama.MamaPrice |
getPrice()
Return the price for this level.
|
char |
getSide()
Return the side (bid/ask) of the book for this level.
|
double |
getSize()
Return the total size (across all entries) for this level.
|
double |
getSizeChange()
Return the size change for this (presumably delta) level.
|
java.lang.String |
getSymbol() |
com.wombat.mama.MamaDateTime |
getTime()
Return the time stamp for when the price level was last updated.
|
void |
markAllDeleted()
Mark everything in this price level as deleted, including
entries.
|
boolean |
reevaluate()
Re-evaluate the price level.
|
void |
removeEntry(MamdaBookAtomicLevelEntry levelEntry)
Remove an order book entry from the price level, where the delete details
are provied by an atomic levelEntry.
|
void |
removeEntry(MamdaOrderBookEntry entry)
Remove an order book entry from the price level.
|
void |
removeEntryById(MamdaBookAtomicLevelEntry levelEntry) |
void |
removeEntryById(MamdaOrderBookEntry entry) |
void |
setAction(char action) |
void |
setAsDifference(MamdaOrderBookPriceLevel lhs,
MamdaOrderBookPriceLevel rhs) |
void |
setDetails(MamdaBookAtomicLevel level)
Take the details from
atomic level |
void |
setDetails(MamdaBookAtomicLevelEntry levelEntry)
Take the details from
atomic levelEntry |
void |
setDetails(MamdaOrderBookPriceLevel level)
Take the details from
level |
void |
setNumEntries(double numEntries) |
void |
setOrderType(char orderType) |
void |
setPrice(double price) |
void |
setPrice(com.wombat.mama.MamaPrice price) |
void |
setSide(char side) |
void |
setSize(double size) |
void |
setSizeChange(double size) |
static void |
setStrictChecking(boolean strict)
Enforce strict checking of order book modifications (at the
expense of some performance).
|
void |
setTime(com.wombat.mama.MamaDateTime time) |
void |
updateEntry(MamdaBookAtomicLevelEntry levelEntry)
Update the details of an existing entry in the level, where the update details
are provied by an atomic levelEntry.
|
void |
updateEntry(MamdaOrderBookEntry entry)
Update the details of an existing entry in the level.
|
public static final char ACTION_ADD
public static final char ACTION_UPDATE
public static final char ACTION_DELETE
public static final char ACTION_UNKNOWN
public static final char SIDE_BID
public static final char SIDE_ASK
public static final char SIDE_UNKNOWN
public static final char LEVEL_LIMIT
public static final char LEVEL_MARKET
public static final char LEVEL_UNKNOWN
public MamdaOrderBookPriceLevel()
public MamdaOrderBookPriceLevel(MamdaOrderBookPriceLevel copy)
copy
- The MamdaOrderBookPriceLevel to copy.public MamdaOrderBookPriceLevel(double price, char side)
public void clear()
public void copy(MamdaOrderBookPriceLevel copy)
copy
- The MamdaOrderBookPriceLevel to copy.public void copy(MamdaBookAtomicLevel copy)
copy
- The MamdaOrderBookPriceLevel to copy.public void copy(MamdaBookAtomicLevelEntry copy)
copy
- The MamdaOrderBookPriceLevel to copy.public void setPrice(com.wombat.mama.MamaPrice price)
public void setPrice(double price)
public void setSize(double size)
public void setSizeChange(double size)
public void setNumEntries(double numEntries)
public void setSide(char side)
public void setAction(char action)
public void setTime(com.wombat.mama.MamaDateTime time)
public void setOrderType(char orderType)
public char getOrderType()
public boolean empty()
public void setDetails(MamdaOrderBookPriceLevel level)
level and apply them to this level.
This does not update entries within the level, only information
pertaining to the level itself.
It is intended that this method should not be used externally to the
API.
level
- The price level object from which the details are being
obtained.public void setDetails(MamdaBookAtomicLevel level)
atomic level and apply them to this level.
This does not update entries within the level, only information
pertaining to the level itself.
It is intended that this method should not be used externally to the
API.
level
- The atomic price level object from which the details are being
obtained.public void setDetails(MamdaBookAtomicLevelEntry levelEntry)
atomic levelEntry and apply them to this levelEntry.
This update entries within the level.
It is intended that this method should not be used externally to the
API.
levelEntry
- The atomic price levelEntry object from which the details are being
obtained.public void addEntry(MamdaOrderBookEntry entry)
entry
- The new entry to be added to the level.MamdaOrderBookEntry
public void updateEntry(MamdaOrderBookEntry entry)
entry
- An instance of MamdaOrderBookEntry
with the
new details for the entry in the level.MamdaOrderBookEntry
public void updateEntry(MamdaBookAtomicLevelEntry levelEntry)
levelEntry
- An instance of MamdaBookAtomicLevelEntry
with the
new details for the entry in the level.MamdaOrderBookEntry
public void removeEntry(MamdaOrderBookEntry entry)
entry
- The entry which is to be removed from the price level.MamdaOrderBookEntry
public void removeEntry(MamdaBookAtomicLevelEntry levelEntry)
levelEntry
- The entry which is to be removed from the price level.MamdaOrderBookEntry
public java.util.Iterator entryIterator()
java.util.Iterator
for all entries within this
level.
Price Level entries are represented by the
MamdaOrderBookEntry
class.public void checkNotExist(MamdaOrderBookEntry entry)
MamdaOrderBookException
exception is thrown. Otherwise the
method simply returns.entry
- The entry whose presence in the level is being determined.MamdaOrderBookException
- If the entry is found in the price
level.public void checkNotExist(MamdaBookAtomicLevelEntry levelEntry)
MamdaOrderBookException
exception is thrown. Otherwise the
method simply returns.entry
- The entry whose presence in the level is being determined.MamdaOrderBookException
- If the entry is found in the price
level.public void markAllDeleted()
public void setAsDifference(MamdaOrderBookPriceLevel lhs, MamdaOrderBookPriceLevel rhs)
public com.wombat.mama.MamaPrice getPrice()
public double getSize()
public double getSizeChange()
public double getNumEntries()
public int getNumEntriesTotal()
public char getSide()
public char getAction()
public com.wombat.mama.MamaDateTime getTime()
public void assertEqual(MamdaOrderBookPriceLevel rhs)
MamdaOrderBookException
public static void setStrictChecking(boolean strict)
public java.lang.String getSymbol()
public void removeEntryById(MamdaOrderBookEntry entry)
public void removeEntryById(MamdaBookAtomicLevelEntry levelEntry)
public void addEntriesFromLevel(MamdaOrderBookPriceLevel bookLevel, MamdaOrderBookEntryFilter filter, MamdaOrderBookBasicDeltaList delta)
public void deleteEntriesFromSource(com.wombat.mama.MamaSource source, MamdaOrderBookBasicDeltaList delta)
public boolean reevaluate()
public MamdaOrderBookEntry getEntryAtPosition(long pos)
pos
- The position of the order book entry.public MamdaOrderBookEntry findOrCreateEntry(java.lang.String id)
public MamdaOrderBookEntry findEntry(java.lang.String id)
Copyright 2007 Wombat Financial Software, Inc.