Diffusion Apple API  6.2.0
Unified Client Library for iOS, tvOS and OS X / macOS
 All Classes Functions Variables Properties Pages
Instance Methods | List of all members
PTDiffusionTimeSeriesRangeQuery Class Reference

Introduction

Builder for queries that select a range of events from a time series.

Since
6.0
Inheritance diagram for PTDiffusionTimeSeriesRangeQuery:

Instance Methods

(instancetype) - forValues
 
(instancetype) - forEdits
 
(nullable instancetype) - editRange
 
(nullable instancetype) - allEdits
 
(nullable instancetype) - latestEdits
 
(instancetype) - fromSequence:
 
(instancetype) - fromStart
 
(instancetype) - fromDate:
 
(instancetype) - fromLastWithCount:
 
(instancetype) - fromLastWithTimeInterval:
 
(instancetype) - toSequence:
 
(instancetype) - toStart
 
(instancetype) - toDate:
 
(instancetype) - nextWithCount:
 
(instancetype) - nextWithTimeInterval:
 
(instancetype) - previousWithCount:
 
(instancetype) - previousWithTimeInterval:
 
(instancetype) - untilLastWithCount:
 
(instancetype) - untilLastWithTimeInterval:
 
(instancetype) - limitWithCount:
 
(BOOL) - isEqualToTimeSeriesRangeQuery:
 

Method Documentation

- (nullable instancetype) allEdits

Return a copy of the receiver configured to perform an edit range query with the edit range that selects all edits in the entire time series.

This operator can only be applied to edit range queries. Newly initialised range query instances are value range queries. The forEdits operator can be used to create an edit range query from a value range query.

Operator type: edit range.

Returns
a copy of the receiver configured to perform an edit range query with a new edit range that selects all edits in the entire time series, or nil if this is not an edit range query.
Since
6.0
- (nullable instancetype) editRange

Return a copy of the receiver configured to perform a value range query with the edit range set to the entire time series.

This operator can only be applied to value range queries. Newly initialised range query instances are value range queries. The forValues operator can be used to create a value range query from an edit range query.

Operator type: edit range.

Returns
a copy of the receiver configured to perform a view range query with a new edit range that selects the entire time series, or nil if this is not a value range query.
Since
6.0
- (instancetype) forEdits

Return a copy of the receiver configured to perform an edit range query with the view range set to the entire time series.

Operator type: value range.

Returns
a copy of the receiver configured to perform an edit range query with a new view range that selects the entire time series.
Since
6.0
- (instancetype) forValues

Return a copy of the receiver configured to perform a value range query with the view range set to the entire time series.

Operator type: value range.

Returns
a copy of the receiver configured to perform a view range query with a new view range that selects the entire time series.
Since
6.0
- (instancetype) fromDate: (NSDate *)  date

Return a copy of the receiver with the anchor of the current range configured to be an absolute time.

Operator type: anchor.

Parameters
dateabsolute time specifying the anchor of range.
Returns
a copy of the receiver with a new anchor.
Since
6.0
- (instancetype) fromLastWithCount: (UInt64)  count

Return a copy of the receiver with the anchor of the current range configured to be a relative offset before the end of the time series.

Operator type: anchor.

Parameters
countspecifies the anchor as a number of events before the end of the time series. For value range queries, count is the number of original events. For edit range queries, count is the number of events of any type.
Returns
a copy of the receiver with a new anchor.
Exceptions
NSInvalidArgumentExceptionif count is greater than INT64_MAX.
Since
6.0
- (instancetype) fromLastWithTimeInterval: (NSTimeInterval)  timeInterval

Return a copy of the receiver with the anchor of the current range configured to be a relative time from the timestamp of the last event in the time series.

Operator type: anchor.

Parameters
timeIntervalspecifies anchor relative to the timestamp of the latest event in the time series.
Returns
a copy of the receiver with a new anchor.
Exceptions
NSInvalidArgumentExceptionif timeInterval is negative.
Since
6.0
- (instancetype) fromSequence: (UInt64)  sequence

Return a copy of the receiver with the anchor of the current range configured to be an absolute sequence number.

Operator type: anchor.

Parameters
sequenceabsolute sequence number specifying the anchor of the returned range.
Returns
a copy of the receiver with a new anchor.
Exceptions
NSInvalidArgumentExceptionif sequence is greater than INT64_MAX.
Since
6.0
- (instancetype) fromStart

Return a copy of the receiver with the anchor of the current range configured to be the start of the time series.

There is a difference between fromStart and fromSequence:0 if the range also ends before the first event of the time series. For example, [[query fromStart] toStart] is always empty, but [[query fromSequence:0] toStart] includes the event with sequence number 0.

Operator type: anchor.

Returns
a copy of the receiver with a new anchor.
Since
6.0
- (BOOL) isEqualToTimeSeriesRangeQuery: (nullable PTDiffusionTimeSeriesRangeQuery *)  timeSeriesRangeQuery

Compares the receiver to the given time series range query.

Parameters
timeSeriesRangeQueryThe time series range query object with which to compare the receiver.
Returns
YES if it is identical to the receiver, otherwise NO.
Since
6.0
- (nullable instancetype) latestEdits

Return a copy of the receiver configured to perform an edit range query with the edit range that selects latest edits in the entire time series.

This operator can only be applied to edit range queries. Newly initialised range query instances are value range queries. The forEdits operator can be used to create an edit range query from a value range query.

Operator type: edit range.

Returns
a copy of the receiver configured to perform an edit range query with a new edit range that selects the latest edits in the entire time series, or nil if this is not an edit range query.
Since
6.0
- (instancetype) limitWithCount: (UInt64)  count

Return a copy of the receiver that returns at most count events.

If the query would otherwise select more than count events, only the latest count values (those with the highest sequence numbers) are returned.

This is most useful when a temporal span has been configured with nextWithTimeInterval: or previousWithTimeInterval: where the potential number of returned events is unknown.

PTDiffusionTimeSeriesQueryResult::complete can be used to determine whether a query has returned an incomplete result.

Operator type: limit.

Parameters
countthe maximum number of events to return.
Returns
a copy of the receiver with a new limit.
Exceptions
NSInvalidArgumentExceptionif count is greater than INT64_MAX.
Since
6.0
- (instancetype) nextWithCount: (UInt64)  count

Return a copy of the receiver with the span of the current range configured to select a range of events following the anchor.

Operator type: span.

Parameters
countspecifies the end of the range of events to select following the anchor. For value range queries, count is the number of original events. For edit range queries, count is the number of events of any type.
Returns
a copy of the receiver with a new span.
Exceptions
NSInvalidArgumentExceptionif count is greater than INT64_MAX.
Since
6.0
- (instancetype) nextWithTimeInterval: (NSTimeInterval)  timeInterval

Return a copy of the receiver with the span of the current range configured to select a temporal range of events following the anchor.

Operator type: span.

Parameters
timeIntervalthe time span of events following the anchor to select.
Returns
a copy of the receiver with a new span.
Exceptions
NSInvalidArgumentExceptionif timeInterval is negative.
Since
6.0
- (instancetype) previousWithCount: (UInt64)  count

Return a copy of the receiver with the span of the current range configured to select a range of events preceding the anchor.

Operator type: span.

Parameters
countspecifies the end of the range of events to select preceding the anchor. For value range queries, count is the number of original events. For edit range queries, count is the number of events of any type.
Returns
a copy of the receiver with a new span.
Exceptions
NSInvalidArgumentExceptionif count is greater than INT64_MAX.
Since
6.0
- (instancetype) previousWithTimeInterval: (NSTimeInterval)  timeInterval

Return a copy of the receiver with the span of the current range configured to select a temporal range of events preceding the anchor.

Operator type: span.

Parameters
timeIntervalthe time span of events preceding the anchor to select.
Returns
a copy of the receiver with a new span.
Exceptions
NSInvalidArgumentExceptionif timeInterval is negative.
Since
6.0
- (instancetype) toDate: (NSDate *)  date

Return a copy of the receiver with the span of the current range configured to end at an absolute time.

Operator type: span.

Parameters
dateabsolute time specifying the end of the range.
Returns
a copy of the receiver with a new span.
Since
6.0
- (instancetype) toSequence: (UInt64)  sequence

Return a copy of the receiver with the span of the current range configured to end at an absolute sequence number.

Operator type: span.

Parameters
sequenceabsolute sequence number specifying the end of the returned range.
Returns
a copy of the receiver with a new span.
Exceptions
NSInvalidArgumentExceptionif sequence is greater than INT64_MAX.
Since
6.0
- (instancetype) toStart

Return a copy of the receiver with the span of the current range configured to end at the start of the time series.

There is a difference between toStart and toSequence:0 if the range also starts before the first event of the time series. For example, [[query fromStart] toStart] is always empty, but [[query fromStart] toSequence:0] includes the event with sequence number 0.

Operator type: span.

Returns
a copy of the receiver with a new span.
Since
6.0
- (instancetype) untilLastWithCount: (UInt64)  count

Return a copy of the receiver with the span of the current range configured to end a number of events before the end of the time series.

Operator type: span.

Parameters
countspecifies the end of the range of events to select as a number of events before the end of the time series. For value range queries, count is the number of original events. For edit range queries, count is the number of events of any type.
Returns
a copy of the receiver with a new span.
Exceptions
NSInvalidArgumentExceptionif count is greater than INT64_MAX.
Since
6.0
- (instancetype) untilLastWithTimeInterval: (NSTimeInterval)  timeInterval

Return a copy of the receiver with the span of the current range configured to end at a relative time from the timestamp of the last event in the time series.

Operator type: span.

Parameters
timeIntervalspecifies the end of the range of events to select relative to the timestamp of the latest event in the time series.
Returns
a copy of the receiver with a new span.
Exceptions
NSInvalidArgumentExceptionif timeInterval is negative.
Since
6.0