com.dxfeed.schedule
Class Schedule

java.lang.Object
  extended by com.dxfeed.schedule.Schedule

public final class Schedule
extends java.lang.Object

Schedule class provides API to retrieve and explore trading schedules of different exchanges and different classes of financial instruments. Each instance of schedule covers separate trading schedule of some class of instruments, i.e. NYSE stock trading schedule or CME corn futures trading schedule. Each schedule splits entire time scale into separate days that are aligned to the specific trading hours of covered trading schedule.


Method Summary
 Day getDayById(int dayId)
          Returns day for specified day identifier.
 Day getDayByTime(long time)
          Returns day that contains specified time.
 Day getDayByYearMonthDay(int yearMonthDay)
          Returns day for specified year, month and day numbers.
static Schedule getInstance(InstrumentProfile profile)
          Returns default schedule instance for specified instrument profile.
static Schedule getInstance(InstrumentProfile profile, java.lang.String venue)
          Returns schedule instance for specified instrument profile and trading venue.
static Schedule getInstance(java.lang.String mic, java.lang.String symbol)
          Deprecated. use getInstance(InstrumentProfile profile) method instead
 Session getSessionByTime(long time)
          Returns session that contains specified time.
static java.util.List<java.lang.String> getTradingVenues(InstrumentProfile profile)
          Returns trading venues for specified instrument profile.
static void setDefaults(byte[] data)
          Sets shared defaults that are used by individual schedule instances.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getInstance

public static Schedule getInstance(InstrumentProfile profile)
Returns default schedule instance for specified instrument profile.

Parameters:
profile - instrument profile those schedule is requested
Returns:
default schedule instance for specified instrument profile

getInstance

public static Schedule getInstance(InstrumentProfile profile,
                                   java.lang.String venue)
Returns schedule instance for specified instrument profile and trading venue.

Parameters:
profile - instrument profile those schedule is requested
venue - trading venue those schedule is requested
Returns:
schedule instance for specified instrument profile and trading venue

getTradingVenues

public static java.util.List<java.lang.String> getTradingVenues(InstrumentProfile profile)
Returns trading venues for specified instrument profile.

Parameters:
profile - instrument profile those trading venues are requested
Returns:
trading venues for specified instrument profile

getInstance

@Deprecated
public static Schedule getInstance(java.lang.String mic,
                                              java.lang.String symbol)
Deprecated. use getInstance(InstrumentProfile profile) method instead

Returns schedule instance for specified exchange identifier (MIC) and market symbol.

Parameters:
mic - exchange identifier (MIC) those schedule is requested
symbol - market symbol those schedule is requested
Returns:
schedule instance for specified exchange identifier (MIC) and market symbol

setDefaults

public static void setDefaults(byte[] data)
                        throws java.io.IOException
Sets shared defaults that are used by individual schedule instances.

Parameters:
data - content of default data
Throws:
java.io.IOException - If an I/O error occurs

getSessionByTime

public Session getSessionByTime(long time)
Returns session that contains specified time.

Parameters:
time - the time to search for
Returns:
session that contains specified time

getDayByTime

public Day getDayByTime(long time)
Returns day that contains specified time. This method will throw IllegalArgumentException if specified time falls outside of valid date range from 0001-01-02 to 9999-12-30.

Parameters:
time - the time to search for
Returns:
day that contains specified time
Throws:
java.lang.IllegalArgumentException - if specified time falls outside of valid date range

getDayById

public Day getDayById(int dayId)
Returns day for specified day identifier. This method will throw IllegalArgumentException if specified day identifier falls outside of valid date range from 0001-01-02 to 9999-12-30.

Parameters:
dayId - day identifier to search for
Returns:
day for specified day identifier
Throws:
java.lang.IllegalArgumentException - if specified day identifier falls outside of valid date range
See Also:
Day.getDayId()

getDayByYearMonthDay

public Day getDayByYearMonthDay(int yearMonthDay)
Returns day for specified year, month and day numbers. Year, month, and day numbers shall be decimally packed in the following way:
YearMonthDay = year * 10000 + month * 100 + day
For example, September 28, 1977 has value 19770928.

If specified day does not exist then this method returns day with the lowest valid YearMonthDay that is greater than specified one. This method will throw IllegalArgumentException if specified year, month and day numbers fall outside of valid date range from 0001-01-02 to 9999-12-30.

Parameters:
yearMonthDay - year, month and day numbers to search for
Returns:
day for specified year, month and day numbers
Throws:
java.lang.IllegalArgumentException - if specified year, month and day numbers fall outside of valid date range
See Also:
Day.getYearMonthDay()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object