|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dxfeed.schedule.Session
public final class Session
Session represents a continuous period of time during which apply same rules regarding trading activity.
For example, regular trading session
is a period of time consisting of one day of business activities
in a financial market, from the opening bell to the closing bell, when regular trading occurs.
Sessions can be either trading or non-trading, with different sets of rules and reasons to exist. Sessions do not overlap with each other - rather they form consecutive chain of adjacent periods of time that cover entire time scale. The point on a border line is considered to belong to following session that starts there. Each session completely fits inside a certain day. Day may contain sessions with zero duration - e.g. indices that post value once a day. Such sessions can be of any appropriate type, trading or non-trading.
Method Summary | |
---|---|
boolean |
containsTime(long time)
Returns true if specified time belongs to this session. |
boolean |
equals(java.lang.Object object)
|
Day |
getDay()
Returns day to which this session belongs. |
long |
getEndTime()
Returns end time of this session (exclusive). |
Session |
getNextSession(SessionFilter filter)
Returns following session accepted by specified filter. |
Session |
getPrevSession(SessionFilter filter)
Returns previous session accepted by specified filter. |
long |
getStartTime()
Returns start time of this session (inclusive). |
SessionType |
getType()
Returns type of this session. |
int |
hashCode()
|
boolean |
isEmpty()
Returns true if this session has zero duration. |
boolean |
isTrading()
Returns true if trading activity is allowed within this session. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public Day getDay()
public SessionType getType()
public boolean isTrading()
true
if trading activity is allowed within this session.
This method is equivalent to expression getType().isTrading()
.
Some sessions may have zero duration - e.g. indices that post value once a day. Such sessions can be of any appropriate type, trading or non-trading.
public boolean isEmpty()
true
if this session has zero duration.
Empty sessions can be used for indices that post value once a day or for convenience.
Such sessions can be of any appropriate type, trading or non-trading.
public long getStartTime()
public long getEndTime()
public boolean containsTime(long time)
true
if specified time belongs to this session.
public Session getPrevSession(SessionFilter filter)
NoSuchElementException
.
Please be careful when selecting appropriate filter - you may find non-trading session using filter that ignores trading attribute. For example, to find previous regular trading session use this code:
Session prevRTH = curSession.getPrevSession(SessionFilter.REGULAR_TRADING);
filter
- the filter to test sessions
java.util.NoSuchElementException
- if no such session was found within one yearpublic Session getNextSession(SessionFilter filter)
NoSuchElementException
.
Please be careful when selecting appropriate filter - you may find non-trading session using filter that ignores trading attribute. For example, to find following regular trading session use this code:
Session nextRTH = curSession.getNextSession(SessionFilter.REGULAR_TRADING);
filter
- the filter to test sessions
java.util.NoSuchElementException
- if no such session was found within one yearpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |