public class SessionFilter extends Object implements Serializable
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.
Modifier and Type | Field and Description |
---|---|
static SessionFilter |
AFTER_MARKET
Accepts any session with type
SessionType.AFTER_MARKET . |
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
( . |
static SessionFilter |
PRE_MARKET
Accepts any session with type
SessionType.PRE_MARKET . |
static SessionFilter |
REGULAR
Accepts any session with type
SessionType.REGULAR . |
protected Boolean |
trading
Required trading flag,
null if not relevant. |
static SessionFilter |
TRADING
Accepts trading sessions only - those with
( . |
protected SessionType |
type
Required type,
null if not relevant. |
Constructor and Description |
---|
SessionFilter(SessionType type,
Boolean trading)
Creates filter with specified type and trading flag conditions.
|
Modifier and Type | Method and Description |
---|---|
boolean |
accept(Session session)
Tests whether or not the specified session is an acceptable result.
|
boolean |
equals(Object object) |
int |
hashCode() |
String |
toString() |
public static final SessionFilter ANY
public static final SessionFilter TRADING
(Session.isTrading()
== true)
.public static final SessionFilter NON_TRADING
(Session.isTrading()
== false)
.public static final SessionFilter NO_TRADING
SessionType.NO_TRADING
.public static final SessionFilter PRE_MARKET
SessionType.PRE_MARKET
.public static final SessionFilter REGULAR
SessionType.REGULAR
.public static final SessionFilter AFTER_MARKET
SessionType.AFTER_MARKET
.protected final SessionType type
null
if not relevant.protected final Boolean trading
null
if not relevant.public SessionFilter(SessionType type, Boolean trading)
Both parameters specify what value corresponding attributes should have.
If some parameter is null
then corresponding attribute is ignored (any value is accepted).
type
- required type, null
if not relevanttrading
- required trading flag, null
if not relevantpublic boolean accept(Session session)
session
- the session to be testedtrue
if specified session is acceptedCopyright © 2002–2023 Devexperts LLC. All rights reserved.