Class 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.
    • Constructor Detail

      • MamdaOrderBookBasicDeltaList

        public MamdaOrderBookBasicDeltaList()
    • 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 - The OutputStream to write the update to.
      • dump

        public void dump()
        Dump the complex update to the output stream.
      • iterator

        public java.util.Iterator iterator()