Class DefaultBook<COOKIE>

  • All Implemented Interfaces:
    Book<COOKIE>, ConcurrentBook<COOKIE>, deltix.qsrv.hf.pub.InstrumentIdentity, deltix.util.lang.CookieContainer<COOKIE>

    public class DefaultBook<COOKIE>
    extends java.lang.Object
    implements ConcurrentBook<COOKIE>
    • Method Detail

      • getLastUpdateTimestamp

        public long getLastUpdateTimestamp()
        Description copied from interface: Book
        Returns time of last update
        Specified by:
        getLastUpdateTimestamp in interface Book<COOKIE>
        Returns:
        time in millis
      • hasEntitlementId

        public boolean hasEntitlementId()
        Specified by:
        hasEntitlementId in interface Book<COOKIE>
        Returns:
        true if market data has data-access-control (DAC)
      • getEntitlementId

        public rtmath.containers.BinaryArray getEntitlementId()
        Specified by:
        getEntitlementId in interface Book<COOKIE>
        Returns:
        market data has data-access-control (DAC) token that was used to build this order book
      • getSymbol

        public java.lang.CharSequence getSymbol()
        Specified by:
        getSymbol in interface deltix.qsrv.hf.pub.InstrumentIdentity
      • getInstrumentType

        public deltix.qsrv.hf.pub.InstrumentType getInstrumentType()
        Specified by:
        getInstrumentType in interface deltix.qsrv.hf.pub.InstrumentIdentity
      • getExchange

        public java.lang.CharSequence getExchange()
        Specified by:
        getExchange in interface Book<COOKIE>
        Returns:
        Exchange or Liquidity Provider name that broadcasts this order book
      • getExchangeCode

        public long getExchangeCode()
        Specified by:
        getExchangeCode in interface Book<COOKIE>
        Returns:
        encoded exchange name of the exchange or liquidity provider that broadcasts this order book. See ExchangeCodec
      • getSize

        public int getSize​(boolean ask)
        Description copied from interface: Book
        Returns number of order book items on specific side (bid or ask) of order book
        Specified by:
        getSize in interface Book<COOKIE>
        Parameters:
        ask - specifies ask side of the book if true, otherwise bid side
        Returns:
        number of order book items on specified side
      • getItem

        public BookItem getItem​(int index,
                                boolean ask)
        Specified by:
        getItem in interface Book<COOKIE>
        Returns:
        order book entry for specified depth and order book side
      • lock

        public void lock()
                  throws java.lang.InterruptedException
        Specified by:
        lock in interface ConcurrentBook<COOKIE>
        Throws:
        java.lang.InterruptedException
      • getCookie

        public COOKIE getCookie()
        Specified by:
        getCookie in interface deltix.util.lang.CookieContainer<COOKIE>
      • setCookie

        public void setCookie​(COOKIE userObject)
        Specified by:
        setCookie in interface deltix.util.lang.CookieContainer<COOKIE>
      • walk

        public void walk​(BookWalker walker)
        Description copied from interface: Book
        Iterate current order book using provided callback
        Specified by:
        walk in interface Book<COOKIE>
      • walk

        public void walk​(BookWalker walker,
                         boolean ask)
        Description copied from interface: Book
        Iterate one side of order book using provided callback
        Specified by:
        walk in interface Book<COOKIE>