AI-generated Key Takeaways
-
TimeIntervals
provides semantic time intervals relative to the current time and location, such as morning, afternoon, weekend, or holiday. -
You can retrieve applicable time intervals using
getTimeIntervals()
, which returns an array of constants. -
hasTimeInterval()
allows you to check if a specific time interval (e.g., TIME_INTERVAL_MORNING) is currently applicable.
The semantic time intervals for the to the current time and location. Some examples of
time intervals are:
TIME_INTERVAL_MORNING
,
TIME_INTERVAL_AFTERNOON
,
TIME_INTERVAL_EVENING
,
TIME_INTERVAL_NIGHT
,
TIME_INTERVAL_WEEKDAY
,
TIME_INTERVAL_WEEKEND
,
TIME_INTERVAL_HOLIDAY
.
Public Method Summary
abstract int[] |
getTimeIntervals()
Get the semantic time intervals for the to the current time and location.
|
abstract boolean |
hasTimeInterval(int desiredTimeInterval)
Returns true if the given semantic time interval is applicable to the current
time and locale
|
Public Methods
public abstract int[] getTimeIntervals ()
Get the semantic time intervals for the to the current time and location.
Returns
- the int constants corresponding to all the semantic time interval labels that are
applicable for the current time and device locale. Valid time interval labels are:
TIME_INTERVAL_MORNING
,TIME_INTERVAL_AFTERNOON
,TIME_INTERVAL_EVENING
,TIME_INTERVAL_NIGHT
,TIME_INTERVAL_WEEKDAY
,TIME_INTERVAL_WEEKEND
,TIME_INTERVAL_HOLIDAY
.
public abstract boolean hasTimeInterval (int desiredTimeInterval)
Returns true if the given semantic time interval is applicable to the current time and locale
Parameters
desiredTimeInterval | is the desired time interval label. |
---|
Returns
- true if the label is applicable to the current time and locale.