com.dxfeed.schedule
Class SessionFilter

java.lang.Object
  extended by com.dxfeed.schedule.SessionFilter
All Implemented Interfaces:
java.io.Serializable

public class SessionFilter
extends java.lang.Object
implements java.io.Serializable

A filter for sessions used by various search methods. This class provides predefined filters for certain Session attributes, although users can create their own filters to suit their needs.

Please note that sessions can be either trading or non-trading, and this distinction can be either based on rules (e.g. weekends) or dictated by special occasions (e.g. holidays). Different filters treat this distinction differently - some accept only trading sessions, some only non-trading, and some ignore type of session altogether.

See Also:
Serialized Form

Field Summary
static SessionFilter AFTER_MARKET
          Accepts any session with type SessionType.AFTER_MARKET.
static SessionFilter AFTER_MARKET_TRADING
          Deprecated. use AFTER_MARKET filter instead.
static SessionFilter ANY
          Accepts any session - useful for pure schedule navigation.
static SessionFilter NO_TRADING
          Accepts any session with type SessionType.NO_TRADING.
static SessionFilter NON_TRADING
          Accepts non-trading sessions only - those with (Session.isTrading() == false).
static SessionFilter PRE_MARKET
          Accepts any session with type SessionType.PRE_MARKET.
static SessionFilter PRE_MARKET_TRADING
          Deprecated. use PRE_MARKET filter instead.
static SessionFilter REGULAR
          Accepts any session with type SessionType.REGULAR.
static SessionFilter REGULAR_TRADING
          Deprecated. use REGULAR filter instead.
static SessionFilter TRADING
          Accepts trading sessions only - those with (Session.isTrading() == true).
 
Constructor Summary
SessionFilter(SessionType type, java.lang.Boolean trading)
          Creates filter with specified type and trading flag conditions.
 
Method Summary
 boolean accept(Session session)
          Tests whether or not the specified session is an acceptable result.
 boolean equals(java.lang.Object object)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ANY

public static final SessionFilter ANY
Accepts any session - useful for pure schedule navigation.


TRADING

public static final SessionFilter TRADING
Accepts trading sessions only - those with (Session.isTrading() == true).


NON_TRADING

public static final SessionFilter NON_TRADING
Accepts non-trading sessions only - those with (Session.isTrading() == false).


NO_TRADING

public static final SessionFilter NO_TRADING
Accepts any session with type SessionType.NO_TRADING.


PRE_MARKET

public static final SessionFilter PRE_MARKET
Accepts any session with type SessionType.PRE_MARKET.


REGULAR

public static final SessionFilter REGULAR
Accepts any session with type SessionType.REGULAR.


AFTER_MARKET

public static final SessionFilter AFTER_MARKET
Accepts any session with type SessionType.AFTER_MARKET.


PRE_MARKET_TRADING

@Deprecated
public static final SessionFilter PRE_MARKET_TRADING
Deprecated. use PRE_MARKET filter instead.

REGULAR_TRADING

@Deprecated
public static final SessionFilter REGULAR_TRADING
Deprecated. use REGULAR filter instead.

AFTER_MARKET_TRADING

@Deprecated
public static final SessionFilter AFTER_MARKET_TRADING
Deprecated. use AFTER_MARKET filter instead.
Constructor Detail

SessionFilter

public SessionFilter(SessionType type,
                     java.lang.Boolean trading)
Creates filter with specified type and trading flag conditions.

Both parameters specify what value corresponding attributes should have. If some parameter is null then corresponding attribute is ignored (any value is accepted).

Parameters:
type - required type, null if not relevant
trading - required trading flag, null if not relevant
Method Detail

accept

public boolean accept(Session session)
Tests whether or not the specified session is an acceptable result.

Parameters:
session - the session to be tested
Returns:
true if specified session is accepted

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object object)
Overrides:
equals in class java.lang.Object

toString

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