Class OrdersList

  • All Implemented Interfaces:
    java.io.Externalizable, java.io.Serializable

    public class OrdersList
    extends java.lang.Object
    implements java.io.Externalizable
    Poznamka - novy format 10, ktery umozni zpetnou kompatibilitu. Do hlavicky se uklada i pocet additional data fieldu, ktere je treba nacist. Kdyz se tedy bude odted (po formatu 10) prodavat dalsi field treba int, tak se zvysi pocet additional intu. Starsi formaty (10+) ten int jenom prectou a nerozpoznaji, novy format int precte a priradi prislusnemu policku.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static org.slf4j.Logger Log
      The Constant Log.
    • Constructor Summary

      Constructors 
      Constructor Description
      OrdersList​(java.lang.String identifier)
      Instantiates a new orders list.
      OrdersList​(java.lang.String identifier, int initialCapacity)
      Instantiates a new orders list.
    • Field Detail

      • Log

        public static final org.slf4j.Logger Log
        The Constant Log.
    • Constructor Detail

      • OrdersList

        public OrdersList​(java.lang.String identifier)
        Instantiates a new orders list.
        Parameters:
        identifier - the identifier
      • OrdersList

        public OrdersList​(java.lang.String identifier,
                          int initialCapacity)
        Instantiates a new orders list.
        Parameters:
        identifier - the identifier
        initialCapacity - the initial capacity
    • Method Detail

      • add

        public void add​(Order o)
        Adds the.
        Parameters:
        o - the o
      • listIterator

        public it.unimi.dsi.fastutil.objects.ObjectListIterator<Order> listIterator()
        List iterator.
        Returns:
        the object list iterator
      • listIterator

        public it.unimi.dsi.fastutil.objects.ObjectListIterator<Order> listIterator​(int size)
        List iterator.
        Parameters:
        size - the size
        Returns:
        the object list iterator
      • add

        public void add​(com.strategyquant.tradinglib.strategy.LiveOrderObj liveOrder)
        Adds the.
        Parameters:
        liveOrder - the live order
      • get

        public Order get​(int index)
        Gets the.
        Parameters:
        index - the index
        Returns:
        the order
      • shuffle

        public void shuffle()
        Shuffle.
      • clear

        public void clear()
        Clear.
      • size

        public int size()
        Size.
        Returns:
        the int
      • addAll

        public void addAll​(OrdersList orders)
        Adds the all.
        Parameters:
        orders - the orders
      • replaceWithList

        public void replaceWithList​(OrdersList orders)
        Replace with list.
        Parameters:
        orders - the orders
      • filter

        public OrdersList filter​(java.lang.String resultKey,
                                 byte direction,
                                 byte sampleType)
        Filter.
        Parameters:
        resultKey - the result key
        direction - the direction
        sampleType - the sample type
        Returns:
        the orders list
      • filter

        public OrdersList filter​(java.lang.String resultKey,
                                 byte direction,
                                 byte sampleType,
                                 boolean onlyFilled)
        Filter.
        Parameters:
        resultKey - the result key
        direction - the direction
        sampleType - the sample type
        onlyFilled - the only filled
        Returns:
        the orders list
      • filterWithClone

        public OrdersList filterWithClone​(java.lang.String resultKey,
                                          byte direction,
                                          byte sampleType)
        Filter with clone.
        Parameters:
        resultKey - the result key
        direction - the direction
        sampleType - the sample type
        Returns:
        the orders list
      • filterExcludingControlOrders

        public OrdersList filterExcludingControlOrders​(java.lang.String resultKey,
                                                       byte direction,
                                                       byte sampleType,
                                                       boolean onlyFilled)
        Filter excluding control orders.
        Parameters:
        resultKey - the result key
        direction - the direction
        sampleType - the sample type
        onlyFilled - the only filled
        Returns:
        the orders list
      • isEmpty

        public boolean isEmpty()
        Checks if is empty.
        Returns:
        true, if is empty
      • clone

        public OrdersList clone()
        creates a clone of give OrdersList. Note - if the list has some filter set only filtered orders will be cloned!
        Returns:
        the orders list
      • remove

        public void remove​(int index)
        remove order at given index.
        Parameters:
        index - the index
      • writeExternal

        public void writeExternal​(java.io.ObjectOutput out)
                           throws java.io.IOException
        Write external.
        Specified by:
        writeExternal in interface java.io.Externalizable
        Parameters:
        out - the out
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • readExternal

        public void readExternal​(java.io.ObjectInput in)
                          throws java.io.IOException,
                                 java.lang.ClassNotFoundException
        Read external.
        Specified by:
        readExternal in interface java.io.Externalizable
        Parameters:
        in - the in
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
        java.lang.ClassNotFoundException - the class not found exception
      • serialize

        public void serialize​(java.io.ObjectOutput dos)
                       throws java.io.IOException
        Serialize.
        Parameters:
        dos - the dos
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • deserialize

        public void deserialize​(java.io.ObjectInput dis)
                         throws java.io.IOException
        Deserialize.
        Parameters:
        dis - the dis
        Throws:
        java.io.IOException - Signals that an I/O exception has occurred.
      • cloneOrders2

        public OrdersList cloneOrders2()
        Clone orders 2.
        Returns:
        the orders list
      • contains

        public boolean contains​(Order o)
        Contains.
        Parameters:
        o - the o
        Returns:
        true, if successful
      • sort

        public void sort​(java.util.Comparator<Order> comparator)
        Sort.
        Parameters:
        comparator - the comparator