public final class

TimeFence

extends Object
java.lang.Object
   ↳ com.google.android.gms.awareness.fence.TimeFence

Class Overview

Use this class to create time-based fences.

Summary

Public Methods
static AwarenessFence inDailyInterval(TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)
This fence is in the TRUE state during the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.
static AwarenessFence inFridayInterval(TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)
This fence is in the TRUE state for Friday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.
static AwarenessFence inInterval(long startTimeMillis, long stopTimeMillis)
This fence is in the TRUE state when the current time is within the absolute times indicated by startTimeMillis and stopTimeMillis.
static AwarenessFence inMondayInterval(TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)
This fence is in the TRUE state for Monday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.
static AwarenessFence inSaturdayInterval(TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)
This fence is in the TRUE state for Saturday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.
static AwarenessFence inSundayInterval(TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)
This fence is in the TRUE state for Sunday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.
static AwarenessFence inThursdayInterval(TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)
This fence is in the TRUE state for Thursday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.
static AwarenessFence inTuesdayInterval(TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)
This fence is in the TRUE state for Tuesday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.
static AwarenessFence inWednesdayInterval(TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)
This fence is in the TRUE state for Wednesday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static AwarenessFence inDailyInterval (TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)

This fence is in the TRUE state during the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.

Parameters
timeZone The time zone to use.
startTimeOfDayMillis Milliseconds since the start of the day. 12:00 am is 0L. The maximum value is the number of milliseconds in a day, namely 24L * 60L * 60L * 1000L.
stopTimeOfDayMillis milliseconds since the start of the day. Same range as startTimeOfDayMillis. This time must be greater than or equal to startTimeOfDayMillis.
Returns

public static AwarenessFence inFridayInterval (TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)

This fence is in the TRUE state for Friday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.

Parameters
timeZone The time zone to use.
startTimeOfDayMillis Milliseconds since the start of the day. 12:00 am is 0L. The maximum value is the number of milliseconds in a day, namely 24L * 60L * 60L * 1000L.
stopTimeOfDayMillis Milliseconds since the start of the day, This time must be greater than or equal to startTimeOfDayMillis.
Returns

public static AwarenessFence inInterval (long startTimeMillis, long stopTimeMillis)

This fence is in the TRUE state when the current time is within the absolute times indicated by startTimeMillis and stopTimeMillis.

Parameters
startTimeMillis Milliseconds since epoch for the start of the interval. Must be greater than or equal to 0L.
stopTimeMillis Milliseconds since epoch for the end of the interval. Must be greater than or equal to startTimeMillis.
Returns

public static AwarenessFence inMondayInterval (TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)

This fence is in the TRUE state for Monday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.

Parameters
timeZone The time zone to use.
startTimeOfDayMillis Milliseconds since the start of the day. 12:00 am is 0L. The maximum value is the number of milliseconds in a day, namely 24L * 60L * 60L * 1000L.
stopTimeOfDayMillis Milliseconds since the start of the day, This time must be greater than or equal to startTimeOfDayMillis.
Returns

public static AwarenessFence inSaturdayInterval (TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)

This fence is in the TRUE state for Saturday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.

Parameters
timeZone The time zone to use.
startTimeOfDayMillis Milliseconds since the start of the day. 12:00 am is 0L. The maximum value is the number of milliseconds in a day, namely 24L * 60L * 60L * 1000L.
stopTimeOfDayMillis Milliseconds since the start of the day, This time must be greater than or equal to startTimeOfDayMillis.
Returns

public static AwarenessFence inSundayInterval (TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)

This fence is in the TRUE state for Sunday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.

Parameters
timeZone The time zone to use.
startTimeOfDayMillis Milliseconds since the start of the day. 12:00 am is 0L. The maximum value is the number of milliseconds in a day, namely 24L * 60L * 60L * 1000L.
stopTimeOfDayMillis Milliseconds since the start of the day, This time must be greater than or equal to startTimeOfDayMillis.
Returns

public static AwarenessFence inThursdayInterval (TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)

This fence is in the TRUE state for Thursday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.

Parameters
timeZone The time zone to use.
startTimeOfDayMillis Milliseconds since the start of the day. 12:00 am is 0L. The maximum value is the number of milliseconds in a day, namely 24L * 60L * 60L * 1000L.
stopTimeOfDayMillis Milliseconds since the start of the day, This time must be greater than or equal to startTimeOfDayMillis.
Returns

public static AwarenessFence inTuesdayInterval (TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)

This fence is in the TRUE state for Tuesday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.

Parameters
timeZone The time zone to use.
startTimeOfDayMillis Milliseconds since the start of the day. 12:00 am is 0L. The maximum value is the number of milliseconds in a day, namely 24L * 60L * 60L * 1000L.
stopTimeOfDayMillis Milliseconds since the start of the day, This time must be greater than or equal to startTimeOfDayMillis.
Returns

public static AwarenessFence inWednesdayInterval (TimeZone timeZone, long startTimeOfDayMillis, long stopTimeOfDayMillis)

This fence is in the TRUE state for Wednesday in the interval specified by startTimeOfDayMillis and stopTimeOfDayMillis in the given timeZone.

Parameters
timeZone The time zone to use.
startTimeOfDayMillis Milliseconds since the start of the day. 12:00 am is 0L. The maximum value is the number of milliseconds in a day, namely 24L * 60L * 60L * 1000L.
stopTimeOfDayMillis Milliseconds since the start of the day, This time must be greater than or equal to startTimeOfDayMillis.
Returns