Venice 0.751beta

nz.org.venice.analyser
Class OrderCache

java.lang.Object
  extended bynz.org.venice.analyser.OrderCache

public class OrderCache
extends java.lang.Object

Caches the order of stock quotes in a quote bundle. The GP allows the user to order the evaluation of stock quotes, by several criteria such as unordered, alphabetically by symbol, volume decreasing etc. This gives priority to certain stocks. For example the user might prefer the GP to concentrate on high volume stocks, so ordering the stocks by volume will give high volume stocks a priority. Since sorting is a slow operation, and the GP traverses over the same day many times, it makes sense to cache the order. Profiling results showed this provides a significant speed increase.

Author:
Andrew Leppard
See Also:
OrderComparator, QuoteRangePage

Constructor Summary
OrderCache(EODQuoteBundle quoteBundle, OrderComparator orderComparator)
          Create a new order cache.
 
Method Summary
 java.util.List getTodaySymbols(int dateOffset)
          Return a list of the given date's ordered symbols.
 boolean isOrdered()
          Return whether the input order comparator is actually ordered.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderCache

public OrderCache(EODQuoteBundle quoteBundle,
                  OrderComparator orderComparator)
Create a new order cache.

Parameters:
quoteBundle - the quotes to order
orderComparator - the method of ordering
Method Detail

getTodaySymbols

public java.util.List getTodaySymbols(int dateOffset)
Return a list of the given date's ordered symbols.

Parameters:
dateOffset - fast access date offset
Returns:
ordered list of symbols

isOrdered

public boolean isOrdered()
Return whether the input order comparator is actually ordered.

Returns:
true if the order comparator is ordered

Venice 0.751beta