public class HKQuantitySeriesSampleBuilder extends NSObject
An HKQuantitySeriesSampleBuilder is used to generate HKQuantitySample(s) with multiple quantities.
An HKQuantitySeriesSampleBuilder is used to incrementally create a new quantity series sample in the HealthKit database. This class may be used to create long-running quantity series samples that are associated with an activity like a workout. After inserting each of the quantities that make up the series, the series may be finalized by calling -finishSeriesWithMetadata:completion:. Calling -discard invalidates the series and discards any data that was previously associated with it.
| Modifier and Type | Class and Description |
|---|---|
static interface |
HKQuantitySeriesSampleBuilder.Block_finishSeriesWithMetadataCompletion |
static interface |
HKQuantitySeriesSampleBuilder.Block_finishSeriesWithMetadataEndDateCompletion |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
HKQuantitySeriesSampleBuilder(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
accessInstanceVariablesDirectly() |
static HKQuantitySeriesSampleBuilder |
alloc() |
static HKQuantitySeriesSampleBuilder |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
static java.lang.String |
debugDescription_static() |
static java.lang.String |
description_static() |
HKDevice |
device()
[@property] device
|
void |
discard()
discard
|
void |
finishSeriesWithMetadataCompletion(NSDictionary<java.lang.String,?> metadata,
HKQuantitySeriesSampleBuilder.Block_finishSeriesWithMetadataCompletion completion)
finishSeriesWithMetadata:completion:
|
void |
finishSeriesWithMetadataEndDateCompletion(NSDictionary<java.lang.String,?> metadata,
NSDate endDate,
HKQuantitySeriesSampleBuilder.Block_finishSeriesWithMetadataEndDateCompletion completion)
finishSeriesWithMetadata:endDate:completion:
|
static long |
hash_static() |
HKQuantitySeriesSampleBuilder |
init() |
HKQuantitySeriesSampleBuilder |
initWithHealthStoreQuantityTypeStartDateDevice(HKHealthStore healthStore,
HKQuantityType quantityType,
NSDate startDate,
HKDevice device)
initWithHealthStore:quantityType:device:
|
boolean |
insertQuantityDateError(HKQuantity quantity,
NSDate date,
org.moe.natj.general.ptr.Ptr<NSError> error)
insertQuantity:date:completion:
|
boolean |
insertQuantityDateIntervalError(HKQuantity quantity,
NSDateInterval dateInterval,
org.moe.natj.general.ptr.Ptr<NSError> error)
insertQuantity:dateInterval:completion:
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
static HKQuantitySeriesSampleBuilder |
new_objc() |
HKQuantityType |
quantityType()
[@property] quantityType
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
static void |
setVersion_static(long aVersion) |
NSDate |
startDate()
[@property] startDate
|
static org.moe.natj.objc.Class |
superclass_static() |
static long |
version_static() |
accessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeyprotected HKQuantitySeriesSampleBuilder(org.moe.natj.general.Pointer peer)
public static boolean accessInstanceVariablesDirectly()
public static HKQuantitySeriesSampleBuilder alloc()
public static HKQuantitySeriesSampleBuilder allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public static java.lang.String debugDescription_static()
public static java.lang.String description_static()
public HKDevice device()
public void discard()
Discards all previously inserted data and invalidates the series.
Calling this method will delete all quantities that were previously inserted into the series and invalidate the receiver. Calling other methods on the receiver after calling -discard will result in an exception.
public void finishSeriesWithMetadataCompletion(NSDictionary<java.lang.String,?> metadata, HKQuantitySeriesSampleBuilder.Block_finishSeriesWithMetadataCompletion completion)
Finalizes the series and returns the resulting HKQuantitySample(s).
Call this method when all quantities for the series have been inserted. The completion handler will return the resulting HKQuantitySample(s) Note that it is possible for a single HKQuantitySeriesSampleBuilder to produce multiple samples. If no quantity data was added, then samples will be nil and an error will be returned. This method functions as a convenience for finishSeriesWithMetadata:endDate:completion: when endDate is nil. After calling this method, the receiver will be considered invalid and calling any other method will result in an error.
metadata - Optional metadata may be added to associate with the series.
Predefined keys are found in HKMetadata.h, or custom NSString
keys used by the client are allowed. Acceptable metadata value types
are NSString, NSDate, NSNumber and HKQuantity.completion - The completion handler will return the resulting HKQuantitySample(s)
for the series. Note that it is possible for a single
HKQuantitySeriesSampleBuilder to produce multiple samples.
If data could not be inserted because of an authorization failure,
samples will be nil and and an error with code
HKErrorAuthorizationDenied or HKErrorAuthorizationNotDetermined
will be returned. If the resulting sample(s) could not be accessed
after they have been created, then samples will be nil and an error
with code HKErrorDatabaseInaccessible will be returned. Any other
error indicates the resulting samples could not be returned.
After calling this method, the receiver will be considered invalid
and calling any other method will result in an error.public void finishSeriesWithMetadataEndDateCompletion(NSDictionary<java.lang.String,?> metadata, NSDate endDate, HKQuantitySeriesSampleBuilder.Block_finishSeriesWithMetadataEndDateCompletion completion)
Finalizes the series and returns the resulting HKQuantitySample(s).
Call this method when all quantities for the series have been inserted. The completion handler will return the resulting HKQuantitySample(s) Note that it is possible for a single HKQuantitySeriesSampleBuilder to produce multiple samples. If no quantity data was added, then samples will be nil and an error will be returned. After calling this method, the receiver will be considered invalid and calling any other method will result in an error.
metadata - Optional metadata may be added to associate with the series.
Predefined keys are found in HKMetadata.h, or custom NSString
keys used by the client are allowed. Acceptable metadata value types
are NSString, NSDate, NSNumber and HKQuantity.endDate - Optional date at which the produced sample(s) end.
An HKErrorInvalidArgument will be returned if endDate
is earlier than the receiver's startDate,
or is earlier than the dateInterval.endDate of any inserted quantity.completion - The completion handler will return the resulting HKQuantitySample(s)
for the series. Note that it is possible for a single
HKQuantitySeriesSampleBuilder to produce multiple samples.
If data could not be inserted because of an authorization failure,
samples will be nil and and an error with code
HKErrorAuthorizationDenied or HKErrorAuthorizationNotDetermined
will be returned. If the resulting sample(s) could not be accessed
after they have been created, then samples will be nil and an error
with code HKErrorDatabaseInaccessible will be returned. Any other
error indicates the resulting samples could not be returned.
After calling this method, the receiver will be considered invalid
and calling any other method will result in an error.public static long hash_static()
public HKQuantitySeriesSampleBuilder init()
public HKQuantitySeriesSampleBuilder initWithHealthStoreQuantityTypeStartDateDevice(HKHealthStore healthStore, HKQuantityType quantityType, NSDate startDate, HKDevice device)
The designated initializer to create an HKQuantitySeriesSampleBuilder.
The HKHealthStore is retained during the life of the object for the saving of the series data and final return of the series sample.
healthStore - Specifies the HKHealthStore object to use for building the series.quantityType - Specifies the quantity type for which to build the series.startDate - The date from which the produced sample(s) start.device - The optional device represents the HKDevice from which the data is
provided.public boolean insertQuantityDateError(HKQuantity quantity, NSDate date, org.moe.natj.general.ptr.Ptr<NSError> error)
Associate a new quantity with the receiver at a specific instantaneous date interval.
This method acts as a convenience for insertQuantity:dateInterval:completion: where dateInterval has a duration of 0.
quantity - The quantity to insert.date - The start date associated with the quantity. If this is the same
start date as a previously-provided quantity, the new value will
replace the old value. An HKErrorInvalidArgument will be returned
if date is earlier than the receiver's startDate.public boolean insertQuantityDateIntervalError(HKQuantity quantity, NSDateInterval dateInterval, org.moe.natj.general.ptr.Ptr<NSError> error)
Associate a new quantity with the receiver with a specific date interval.
Use this method to add a quantity to the series. The quantity must have a unit that is compatible with the receiver's quantity type. See -[HKQuantityType isCompatibleWithUnit:]. Note that quantities may be inserted in any order, but will be sorted by dateInterval.startDate when the series is finished.
quantity - The quantity to insert.dateInterval - The dateInterval associated with the quantity.
If dateInterval.startDate is the same as a previously-provided
quantity, the new value will replace the old value.
An HKErrorInvalidArgument will be returned if
dateInterval.startDate is earlier than the receiver's startDate.public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static HKQuantitySeriesSampleBuilder new_objc()
public HKQuantityType quantityType()
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public static void setVersion_static(long aVersion)
public NSDate startDate()
public static org.moe.natj.objc.Class superclass_static()
public static long version_static()