Class OrdersList

java.lang.Object
com.strategyquant.tradinglib.OrdersList
All Implemented Interfaces:
Externalizable, Serializable

public class OrdersList extends Object implements 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 Details

    • Log

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

    • OrdersList

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

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

    • 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(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(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(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(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(ObjectOutput out) throws IOException
      Write external.
      Specified by:
      writeExternal in interface Externalizable
      Parameters:
      out - the out
      Throws:
      IOException - Signals that an I/O exception has occurred.
    • readExternal

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

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

      public void deserialize(ObjectInput dis) throws IOException
      Deserialize.
      Parameters:
      dis - the dis
      Throws:
      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(Comparator<Order> comparator)
      Sort.
      Parameters:
      comparator - the comparator
    • removeEndOfTest

      public void removeEndOfTest()