|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mov.quote.EODQuoteRange
public class EODQuoteRange
This class represents a way of describing a range or a set of end-of-day quotes. A range of quotes will consist of a set of symbols that we are interested in. This can be described by either explicitly giving a set of symbols, e.g. ANZ, CBA, NBA, WBC. Or by specifying the type of symbols we are intersted in, e.g. all ordinaries, all symbols, market indices etc.
The quote range is also limited by a date range.
For example this class could represent all CBA quotes from 1/12/2000 to 12/12/2000, or all market indices.
A quote range represents a range or set of quotes. It does not represent the actual
quotes themselves. The class that represents the quotes in a quote range is
QuoteBundle
.
Field Summary | |
---|---|
static int |
ALL_ORDINARIES
Represents all 3 letter symbols, not included market indices |
static int |
ALL_SYMBOLS
Represents all symbols |
static int |
GIVEN_SYMBOLS
Represents an explicit list of symbols |
static int |
MARKET_INDICES
Represents market indices |
Constructor Summary | |
---|---|
EODQuoteRange(int type)
Create a quote range that represents all the symbols of the given type for all the dates we have quotes. |
|
EODQuoteRange(int type,
TradingDate date)
Create a quote range that represents all the symbols of the given type on the given date. |
|
EODQuoteRange(int type,
TradingDate firstDate,
TradingDate lastDate)
Create a quote range that represents all the symbols of the given type between the first and the last dates given (inclusive). |
|
EODQuoteRange(java.util.List symbols)
Create a quote range that represents all the given symbols for all the dates we have quotes. |
|
EODQuoteRange(java.util.List symbols,
TradingDate date)
Create a quote range that represents all the given symbols on the given date. |
|
EODQuoteRange(java.util.List symbols,
TradingDate firstDate,
TradingDate lastDate)
Create a quote range that represents all the given symbols between the first and the last dates given (inclusive). |
|
EODQuoteRange(java.util.SortedSet symbols)
Create a quote range that represents all the given symbols for all the dates we have quotes. |
|
EODQuoteRange(Symbol symbol)
Create a quote range that represents the given symbol for all the dates we have quotes. |
|
EODQuoteRange(Symbol symbol,
TradingDate firstDate,
TradingDate lastDate)
Create a quote range that represents the given symbol between the first and the last dates given (inclusive). |
Method Summary | |
---|---|
void |
addSymbol(Symbol symbol)
Expand the quote range to include a new symbol. |
EODQuoteRange |
clip(EODQuoteRange quoteRange)
Return a new clipped quote range that, if possible, does not overlap with this quote range. |
java.lang.Object |
clone()
Create a clone of this quote range. |
boolean |
containsAllSymbols(java.util.List containedSymbols)
Returns whether the quote range contains all the given symbols. |
boolean |
containsSymbol(Symbol symbol)
Returns whether the quote range contains the given symbol. |
java.util.List |
getAllSymbols()
Return all the symbols in the quote range. |
java.lang.String |
getDescription()
Creates a string representation of the quote range without referring to the dates. |
static java.lang.String |
getDescription(int type)
Creates a string representation of the given quote range type. |
TradingDate |
getFirstDate()
Get the first date of the quote range. |
TradingDate |
getLastDate()
Get the last date of the quote range. |
int |
getType()
Get the type of the quote range. |
boolean |
isEmpty()
Return whether this quote range includes any quotes. |
void |
setFirstDate(TradingDate firstDate)
Set the first date of the quote range. |
void |
setLastDate(TradingDate lastDate)
Set the last date of the quote range. |
java.lang.String |
toString()
Create a string representation of the quote range. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ALL_ORDINARIES
public static final int ALL_SYMBOLS
public static final int MARKET_INDICES
public static final int GIVEN_SYMBOLS
Constructor Detail |
---|
public EODQuoteRange(java.util.List symbols)
symbols
- list of symbolspublic EODQuoteRange(java.util.SortedSet symbols)
symbols
- list of symbolspublic EODQuoteRange(java.util.List symbols, TradingDate firstDate, TradingDate lastDate)
symbols
- list of symbolsfirstDate
- earliest datelastDate
- latest datepublic EODQuoteRange(java.util.List symbols, TradingDate date)
symbols
- list of symbolsdate
- the datepublic EODQuoteRange(Symbol symbol)
symbol
- the symbolpublic EODQuoteRange(Symbol symbol, TradingDate firstDate, TradingDate lastDate)
symbol
- the symbolfirstDate
- earliest datelastDate
- latest datepublic EODQuoteRange(int type, TradingDate date)
type
- the type, one of ALL_ORDINARIES
, ALL_SYMBOLS
,
MARKET_INDICES
date
- the datepublic EODQuoteRange(int type, TradingDate firstDate, TradingDate lastDate)
type
- the type, one of ALL_ORDINARIES
, ALL_SYMBOLS
,
MARKET_INDICES
firstDate
- earliest datelastDate
- latest datepublic EODQuoteRange(int type)
type
- the type, one of ALL_ORDINARIES
, ALL_SYMBOLS
,
MARKET_INDICES
Method Detail |
---|
public java.lang.Object clone()
clone
in class java.lang.Object
public java.util.List getAllSymbols()
public void setFirstDate(TradingDate firstDate)
firstDate
- earliest datepublic void setLastDate(TradingDate lastDate)
lastDate
- latest datepublic TradingDate getFirstDate()
null
indicates
that the quote range encompasses all available datespublic TradingDate getLastDate()
null
indicates
that the quote range encompasses all available datespublic boolean isEmpty()
true
if this quote range covers an empty range,
false
otherwise.public int getType()
ALL_ORDINARIES
, ALL_SYMBOLS
,
MARKET_INDICES
, GIVEN_SYMBOLS
public boolean containsSymbol(Symbol symbol)
symbol
- the symbol
true
if the symbol is in the quote range, false
otherwisepublic void addSymbol(Symbol symbol)
symbol
- new symbolpublic boolean containsAllSymbols(java.util.List containedSymbols)
containedSymbols
- all the symbols to check for
true
if all the symbols are in the quote range, false
otherwisepublic java.lang.String getDescription()
public static java.lang.String getDescription(int type)
type
- the type, one of ALL_ORDINARIES
, ALL_SYMBOLS
,
MARKET_INDICES
or GIVEN_SYMBOLS
public java.lang.String toString()
toString
in class java.lang.Object
public EODQuoteRange clip(EODQuoteRange quoteRange)
e.g.
EODQuoteRange quoteRange = new EODQuoteRange("CBA", new TradingDate(2000, 1, 1), new TradingDate(2000, 12, 1)); EODQuoteRange quoteRange2 = new EODQuoteRange("CBA", new TradingDate(1999, 1, 1), new TradingDate(2000, 6, 6)); EODQuoteRange clippedQuoteRange = quoteRange.clipRange(quoteRange2); System.out.println(clippedQuoteRange); >> cba between 1-1-1999 and 31-12-1999
quoteRange
- quote range to clip
|
Venice 0.7beta | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |