Package com.strategyquant.tradinglib
Class OrdersList
java.lang.Object
com.strategyquant.tradinglib.OrdersList
- All Implemented Interfaces:
Externalizable,Serializable
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 -
Constructor Summary
ConstructorsConstructorDescriptionOrdersList(String identifier)Instantiates a new orders list.OrdersList(String identifier, int initialCapacity)Instantiates a new orders list. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the.voidadd(com.strategyquant.tradinglib.strategy.LiveOrderObj liveOrder)Adds the.voidaddAll(OrdersList orders)Adds the all.voidclear()Clear.clone()creates a clone of give OrdersList.Clone orders 2.booleanContains.voiddeserialize(ObjectInput dis)Deserialize.Filter.Filter.filterExcludingControlOrders(String resultKey, byte direction, byte sampleType, boolean onlyFilled)Filter excluding control orders.filterWithClone(String resultKey, byte direction, byte sampleType)Filter with clone.get(int index)Gets the.booleanisEmpty()Checks if is empty.it.unimi.dsi.fastutil.objects.ObjectListIterator<Order>List iterator.it.unimi.dsi.fastutil.objects.ObjectListIterator<Order>listIterator(int size)List iterator.voidreadExternal(ObjectInput in)Read external.voidremove(int index)remove order at given index.voidvoidreplaceWithList(OrdersList orders)Replace with list.voidserialize(ObjectOutput dos)Serialize.voidshuffle()Shuffle.intsize()Size.voidsort(Comparator<Order> comparator)Sort.voidwriteExternal(ObjectOutput out)Write external.
-
Field Details
-
Log
public static final org.slf4j.Logger LogThe Constant Log.
-
-
Constructor Details
-
OrdersList
Instantiates a new orders list.- Parameters:
identifier- the identifier
-
OrdersList
Instantiates a new orders list.- Parameters:
identifier- the identifierinitialCapacity- the initial capacity
-
-
Method Details
-
add
Adds the.- Parameters:
o- the o
-
listIterator
List iterator.- Returns:
- the object list iterator
-
listIterator
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
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
Adds the all.- Parameters:
orders- the orders
-
replaceWithList
Replace with list.- Parameters:
orders- the orders
-
filter
Filter.- Parameters:
resultKey- the result keydirection- the directionsampleType- the sample type- Returns:
- the orders list
-
filter
Filter.- Parameters:
resultKey- the result keydirection- the directionsampleType- the sample typeonlyFilled- the only filled- Returns:
- the orders list
-
filterWithClone
Filter with clone.- Parameters:
resultKey- the result keydirection- the directionsampleType- 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 keydirection- the directionsampleType- the sample typeonlyFilled- the only filled- Returns:
- the orders list
-
isEmpty
public boolean isEmpty()Checks if is empty.- Returns:
- true, if is empty
-
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
Write external.- Specified by:
writeExternalin interfaceExternalizable- Parameters:
out- the out- Throws:
IOException- Signals that an I/O exception has occurred.
-
readExternal
Read external.- Specified by:
readExternalin interfaceExternalizable- Parameters:
in- the in- Throws:
IOException- Signals that an I/O exception has occurred.ClassNotFoundException- the class not found exception
-
serialize
Serialize.- Parameters:
dos- the dos- Throws:
IOException- Signals that an I/O exception has occurred.
-
deserialize
Deserialize.- Parameters:
dis- the dis- Throws:
IOException- Signals that an I/O exception has occurred.
-
cloneOrders2
Clone orders 2.- Returns:
- the orders list
-
contains
Contains.- Parameters:
o- the o- Returns:
- true, if successful
-
sort
Sort.- Parameters:
comparator- the comparator
-
removeEndOfTest
public void removeEndOfTest()
-