|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mov.analyser.OrderComparator
public class OrderComparator
This comparator orders the stock quotes on a given date. The GP allows the user or order the evaluation of stock quotes, by several criteria such as unordered, alphabetically by symbol, volume decreasing etc. This comparator performs the ordering.
OrderCache
,
QuoteRangePage
Field Summary | |
---|---|
static int |
CHANGE_DECREASING
Order the stock symbols by the highest change on the date. |
static int |
CHANGE_INCREASING
Order the stock symbols by the lowest change on the date. |
static int |
DAY_CLOSE_DECREASING
Order the stock symbols by the highest day close on the date. |
static int |
DAY_CLOSE_INCREASING
Order the stock symbols by the lowest day close on the date. |
static int |
DAY_HIGH_DECREASING
Order the stock symbols by the highest day high on the date. |
static int |
DAY_HIGH_INCREASING
Order the stock symbols by the lowest day high on the date. |
static int |
DAY_LOW_DECREASING
Order the stock symbols by the highest day low on the date. |
static int |
DAY_LOW_INCREASING
Order the stock symbols by the lowest day low on the date. |
static int |
DAY_OPEN_DECREASING
Order the stock symbols by the highest day open on the date. |
static int |
DAY_OPEN_INCREASING
Order the stock symbols by the lowest day open on the date. |
static int |
DAY_VOLUME_DECREASING
Order the stock symbols by the highest volume on the date. |
static int |
DAY_VOLUME_INCREASING
Order the stock symbols by the lowest volume on the date. |
static int |
EQUATION
Order the stock symbols by the given equation. |
static int |
NO_ORDER
Don't order the stock symbols. |
static int |
STOCK_SYMBOL
Order the stock symbols alphabetically. |
Constructor Summary | |
---|---|
OrderComparator(EODQuoteBundle quoteBundle,
Expression orderByEquation)
Create a new order comparator that will order the quotes in the given quote bundle using the given equation. |
|
OrderComparator(EODQuoteBundle quoteBundle,
int orderByKey)
Create a new order comparator that will order the quotes in the given quote bundle using the given order. |
Method Summary | |
---|---|
int |
compare(java.lang.Object object1,
java.lang.Object object2)
Compare two stock symbols on the date set by setDateOffset(int) . |
int |
getOrderByKey()
Return the method of ordering. |
boolean |
isOrdered()
Return whether the stock quotes are ordered. |
void |
setDateOffset(int dateOffset)
Set the date to order the stock quotes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Comparator |
---|
equals |
Field Detail |
---|
public static final int NO_ORDER
public static final int STOCK_SYMBOL
public static final int DAY_VOLUME_DECREASING
public static final int DAY_VOLUME_INCREASING
public static final int DAY_LOW_DECREASING
public static final int DAY_LOW_INCREASING
public static final int DAY_HIGH_DECREASING
public static final int DAY_HIGH_INCREASING
public static final int DAY_OPEN_DECREASING
public static final int DAY_OPEN_INCREASING
public static final int DAY_CLOSE_DECREASING
public static final int DAY_CLOSE_INCREASING
public static final int CHANGE_DECREASING
public static final int CHANGE_INCREASING
public static final int EQUATION
Constructor Detail |
---|
public OrderComparator(EODQuoteBundle quoteBundle, int orderByKey)
quoteBundle
- quote data used for orderingorderByKey
- method of orderingpublic OrderComparator(EODQuoteBundle quoteBundle, Expression orderByEquation)
quoteBundle
- quote data used for orderingorderByEquation
- equation used for orderingMethod Detail |
---|
public int getOrderByKey()
EQUATION
.
public boolean isOrdered()
true
if the order is not NO_ORDER
.public void setDateOffset(int dateOffset)
dateOffset
- fast access date offsetpublic int compare(java.lang.Object object1, java.lang.Object object2)
setDateOffset(int)
.
compare
in interface java.util.Comparator
object1
- first symbolobject2
- second symbol
-1
if the first symbol comes first,
0
if the symbols are equal OR
1
if the first symbol comes last.
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |