|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.dxfeed.schedule.DayFilter
public class DayFilter
A filter for days used by various search methods. This class provides predefined filters for certain Day attributes, although users can create their own filters to suit their needs.
Please note that days 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 days, some only non-trading, and some ignore type of day altogether.
Field Summary | |
---|---|
static DayFilter |
ANY
Accepts any day - useful for pure calendar navigation. |
static DayFilter |
FRIDAY
Accepts Fridays only - those with ( . |
static DayFilter |
HOLIDAY
Accepts holidays only - those with ( . |
static DayFilter |
MONDAY
Accepts Mondays only - those with ( . |
static DayFilter |
NO_TRADING
Deprecated. use NON_TRADING filter instead. |
static DayFilter |
NON_TRADING
Accepts non-trading days only - those with ( . |
static DayFilter |
SATURDAY
Accepts Saturdays only - those with ( . |
static DayFilter |
SHORT_DAY
Accepts short days only - those with ( . |
static DayFilter |
SUNDAY
Accepts Sundays only - those with ( . |
static DayFilter |
THURSDAY
Accepts Thursdays only - those with ( . |
static DayFilter |
TRADING
Accepts trading days only - those with ( . |
static DayFilter |
TUESDAY
Accepts Tuesdays only - those with ( . |
static DayFilter |
WEDNESDAY
Accepts Wednesdays only - those with ( . |
static DayFilter |
WEEK_DAY
Accepts week-days only - those with ( . |
static DayFilter |
WEEK_END
Accepts weekends only - those with ( . |
Constructor Summary | |
---|---|
DayFilter(int dayOfWeekMask,
java.lang.Boolean holiday,
java.lang.Boolean shortDay,
java.lang.Boolean trading)
Creates filter with specified conditions. |
Method Summary | |
---|---|
boolean |
accept(Day day)
Tests whether or not the specified day 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 |
---|
public static final DayFilter ANY
public static final DayFilter TRADING
(Day.isTrading()
== true)
.
public static final DayFilter NON_TRADING
(Day.isTrading()
== false)
.
@Deprecated public static final DayFilter NO_TRADING
NON_TRADING
filter instead.public static final DayFilter HOLIDAY
(Day.isHoliday()
== true)
.
public static final DayFilter SHORT_DAY
(Day.isShortDay()
== true)
.
public static final DayFilter MONDAY
(Day.getDayOfWeek()
== 1)
.
public static final DayFilter TUESDAY
(Day.getDayOfWeek()
== 2)
.
public static final DayFilter WEDNESDAY
(Day.getDayOfWeek()
== 3)
.
public static final DayFilter THURSDAY
(Day.getDayOfWeek()
== 4)
.
public static final DayFilter FRIDAY
(Day.getDayOfWeek()
== 5)
.
public static final DayFilter SATURDAY
(Day.getDayOfWeek()
== 6)
.
public static final DayFilter SUNDAY
(Day.getDayOfWeek()
== 7)
.
public static final DayFilter WEEK_DAY
(Day.getDayOfWeek()
<= 5)
.
public static final DayFilter WEEK_END
(Day.getDayOfWeek()
>= 6)
.
Constructor Detail |
---|
public DayFilter(int dayOfWeekMask, java.lang.Boolean holiday, java.lang.Boolean shortDay, java.lang.Boolean trading)
The dayOfWeekMask
is a bitwise mask with individual bits for each day of week.
For the day of week number N the N'th bit is used - the Day will be accepted if corresponding bit is set.
If no bits is set (if mask is zero) then day of week attribute is ignored (any value is accepted).
The boolean parameters specify what value corresponding attributes should have.
If some parameter is null
then corresponding attribute is ignored (any value is accepted).
dayOfWeekMask
- bitwise mask of required days (2 for Monday, 4 for Tuesday, 128 for Sunday), 0
if not relevantholiday
- required holiday flag, null
if not relevantshortDay
- required short day flag, null
if not relevanttrading
- required trading flag, null
if not relevantMethod Detail |
---|
public boolean accept(Day day)
day
- the day to be tested
true
if specified day is acceptedpublic 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 |