Package apple.healthkit
Class HKWorkoutBuilder
- java.lang.Object
-
- org.moe.natj.general.NativeObject
-
- org.moe.natj.objc.ObjCObject
-
- apple.NSObject
-
- apple.healthkit.HKWorkoutBuilder
-
- All Implemented Interfaces:
NSObject
public class HKWorkoutBuilder extends NSObject
HKWorkoutBuilder An HKWorkoutBuilder is used to incrementally create new workouts in the HealthKit database. Samples, events, and metadata may be added to a builder either during a live workout session or to create a workout that occurred in the past. Calling finishWorkoutWithCompletion: will create a new workout with samples, events, and metadata that have been provided.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceHKWorkoutBuilder.Block_addMetadataCompletionstatic interfaceHKWorkoutBuilder.Block_addSamplesCompletionstatic interfaceHKWorkoutBuilder.Block_addWorkoutEventsCompletionstatic interfaceHKWorkoutBuilder.Block_beginCollectionWithStartDateCompletionstatic interfaceHKWorkoutBuilder.Block_endCollectionWithEndDateCompletionstatic interfaceHKWorkoutBuilder.Block_finishWorkoutWithCompletion-
Nested classes/interfaces inherited from class apple.NSObject
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedHKWorkoutBuilder(org.moe.natj.general.Pointer peer)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleanaccessInstanceVariablesDirectly()voidaddMetadataCompletion(NSDictionary<java.lang.String,?> metadata, HKWorkoutBuilder.Block_addMetadataCompletion completion)addMetadata:completion: Adds new metadata to the builder instance.voidaddSamplesCompletion(NSArray<? extends HKSample> samples, HKWorkoutBuilder.Block_addSamplesCompletion completion)addSamples:completion: Adds new samples to the builder instance.voidaddWorkoutEventsCompletion(NSArray<? extends HKWorkoutEvent> workoutEvents, HKWorkoutBuilder.Block_addWorkoutEventsCompletion completion)addWorkoutEvents:completion: Adds new workout events to the builder instance.static HKWorkoutBuilderalloc()static java.lang.ObjectallocWithZone(org.moe.natj.general.ptr.VoidPtr zone)static booleanautomaticallyNotifiesObserversForKey(java.lang.String key)voidbeginCollectionWithStartDateCompletion(NSDate startDate, HKWorkoutBuilder.Block_beginCollectionWithStartDateCompletion completion)beginCollectionWithStartDate:error: Sets the workout start date and activates the workout builder.static voidcancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)static voidcancelPreviousPerformRequestsWithTargetSelectorObject(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.ClassclassForKeyedUnarchiver()static java.lang.StringdebugDescription_static()static java.lang.Stringdescription_static()HKDevicedevice()[@property] device The HKDevice to be associated with the workout.voiddiscardWorkout()discardWorkout Finishes building the workout and discards ther result instead of saving it.doubleelapsedTimeAtDate(NSDate date)elapsedTimeAtDate: The elapsed duration of the workout evaluated at the specified date.voidendCollectionWithEndDateCompletion(NSDate endDate, HKWorkoutBuilder.Block_endCollectionWithEndDateCompletion completion)endCollectionWithEndDate:error: Sets the workout end date and deactivates the workout builer.NSDateendDate()[@property] endDate The end date for the workout, as provided by endCollectionWithEndDate:completion:voidfinishWorkoutWithCompletion(HKWorkoutBuilder.Block_finishWorkoutWithCompletion completion)finishWorkoutWithCompletion: Creates and saves an HKWorkout using samples and events that have been added to workout previously.static longhash_static()HKWorkoutBuilderinit()HKWorkoutBuilderinitWithHealthStoreConfigurationDevice(HKHealthStore healthStore, HKWorkoutConfiguration configuration, HKDevice device)initWithHealthStore:configuration:device: The designated initializer to create an HKWorkoutBuilder.static NSObject.Function_instanceMethodForSelector_retinstanceMethodForSelector(org.moe.natj.objc.SEL aSelector)static NSMethodSignatureinstanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)static booleaninstancesRespondToSelector(org.moe.natj.objc.SEL aSelector)static booleanisSubclassOfClass(org.moe.natj.objc.Class aClass)static NSSet<java.lang.String>keyPathsForValuesAffectingValueForKey(java.lang.String key)NSDictionary<java.lang.String,?>metadata()[@property] metadata The metadata that will be used when the workout is finished.static java.lang.Objectnew_objc()static booleanresolveClassMethod(org.moe.natj.objc.SEL sel)static booleanresolveInstanceMethod(org.moe.natj.objc.SEL sel)HKSeriesBuilderseriesBuilderForType(HKSeriesType seriesType)seriesBuilderForType: Retrieves the associated series builder for the specified type.static voidsetVersion_static(long aVersion)NSDatestartDate()[@property] startDate The start date for the workout, as provided by beginCollectionWithStartDate:completion:HKStatisticsstatisticsForType(HKQuantityType quantityType)statisticsForType: Returns an HKStatistics object containing the statistics for all the samples of the given type that have been added to the receiver.static org.moe.natj.objc.Classsuperclass_static()static longversion_static()HKWorkoutConfigurationworkoutConfiguration()[@property] workoutConfiguration The configuration for the workout being built.NSArray<? extends HKWorkoutEvent>workoutEvents()[@property] workoutEvents Workout events that have been added to the builder.-
Methods inherited from class apple.NSObject
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, willChangeValuesAtIndexesForKey
-
-
-
-
Method Detail
-
accessInstanceVariablesDirectly
public static boolean accessInstanceVariablesDirectly()
-
addMetadataCompletion
public void addMetadataCompletion(NSDictionary<java.lang.String,?> metadata, HKWorkoutBuilder.Block_addMetadataCompletion completion)
addMetadata:completion: Adds new metadata to the builder instance. This method can be called more than once; each time the newly provided metadata will be merged with previously added metadata in the same manner as -[NSMutableDictionary addEntriesFromDictionary:]. This operation is performed asynchronously and the completion will be executed on an arbitrary background queue.- Parameters:
metadata- The metadata to add to the workout.completion- Block to be called when the addition of metadata to the builder is complete. If success is YES, the metadata has been added to the builder successfully. If success is NO, error will be non-null and will contain the error encountered during the insertion operation. When an error occurs, the builder's metadata property will remain unchanged.
-
addSamplesCompletion
public void addSamplesCompletion(NSArray<? extends HKSample> samples, HKWorkoutBuilder.Block_addSamplesCompletion completion)
addSamples:completion: Adds new samples to the builder instance. This method can be called multiple times to add samples incrementally to the builder. The samples will be saved to the database if they have not already been saved. The constraints of -[HKHealthStore saveObject:withCompletion:] apply to this method as well. The start date of the samples must be later than the start date of the receiver. It is an error to call this method after finishWorkoutWithCompletion: has been called. This operation is performed asynchronously and the completion will be executed on an arbitrary background queue.- Parameters:
samples- The samples to add to the workout.completion- Block to be called when the insertion is complete. If success is YES, the samples were added to the builder successfully. If success is NO, error will be non-nil and contain the error encountered while adding the new samples.
-
addWorkoutEventsCompletion
public void addWorkoutEventsCompletion(NSArray<? extends HKWorkoutEvent> workoutEvents, HKWorkoutBuilder.Block_addWorkoutEventsCompletion completion)
addWorkoutEvents:completion: Adds new workout events to the builder instance. This method can be called many times to add workout events incrementally to the builder. It is an error to call this method after finishWorkoutWithCompletion: has been called. This operation is performed asynchronously and the completion will be executed on an arbitrary background queue.- Parameters:
workoutEvents- The events to add to the builder.completion- Block to be called when the addition of events to the builder is complete. If success is YES, the events were added to the builder successfully. If success is NO, error will be non-null and will contain the error encountered during the insertion operation.
-
alloc
public static HKWorkoutBuilder alloc()
-
allocWithZone
public static java.lang.Object allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
-
automaticallyNotifiesObserversForKey
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
-
beginCollectionWithStartDateCompletion
public void beginCollectionWithStartDateCompletion(NSDate startDate, HKWorkoutBuilder.Block_beginCollectionWithStartDateCompletion completion)
beginCollectionWithStartDate:error: Sets the workout start date and activates the workout builder. Calling this method is required before any samples, events or metadata can be added to the builder.- Parameters:
startDate- The start date of the workout.completion- Called once data collection has started or has failed to start.
-
cancelPreviousPerformRequestsWithTarget
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
-
cancelPreviousPerformRequestsWithTargetSelectorObject
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget, org.moe.natj.objc.SEL aSelector, java.lang.Object anArgument)
-
classFallbacksForKeyedArchiver
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
-
classForKeyedUnarchiver
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
-
debugDescription_static
public static java.lang.String debugDescription_static()
-
description_static
public static java.lang.String description_static()
-
device
public HKDevice device()
[@property] device The HKDevice to be associated with the workout.
-
discardWorkout
public void discardWorkout()
discardWorkout Finishes building the workout and discards ther result instead of saving it. Samples that were added to the workout will not be deleted. Adding samples, events, and metadata to the receiver after discardWorkout has been called is an error.
-
elapsedTimeAtDate
public double elapsedTimeAtDate(NSDate date)
elapsedTimeAtDate: The elapsed duration of the workout evaluated at the specified date. The duration does not include periods when the workout was paused, which are the intervals between pause and resume events.
-
endCollectionWithEndDateCompletion
public void endCollectionWithEndDateCompletion(NSDate endDate, HKWorkoutBuilder.Block_endCollectionWithEndDateCompletion completion)
endCollectionWithEndDate:error: Sets the workout end date and deactivates the workout builer. Calling this method is required before you finish a workout builder.- Parameters:
endDate- The end date of the workout.completion- Called once data collection has stopped or has failed to stop.
-
endDate
public NSDate endDate()
[@property] endDate The end date for the workout, as provided by endCollectionWithEndDate:completion:
-
finishWorkoutWithCompletion
public void finishWorkoutWithCompletion(HKWorkoutBuilder.Block_finishWorkoutWithCompletion completion)
finishWorkoutWithCompletion: Creates and saves an HKWorkout using samples and events that have been added to workout previously.- Parameters:
completion- Block to be called after the HKWorkout object has been created and saved. If success is NO, then error will be the error encountered during the operation.
-
hash_static
public static long hash_static()
-
init
public HKWorkoutBuilder init()
-
initWithHealthStoreConfigurationDevice
public HKWorkoutBuilder initWithHealthStoreConfigurationDevice(HKHealthStore healthStore, HKWorkoutConfiguration configuration, HKDevice device)
initWithHealthStore:configuration:device: The designated initializer to create an HKWorkoutBuilder. Creates a new HKWorkoutBuilder unconnected to any HKWorkoutSession or any sources of data.- Parameters:
healthStore- Specifies the HKHealthStore object to use for building the workout. The store is retained until the builder is finished and a workout has been saved or discarded.configuration- The workout configuration to be used.device- The HKDevice to attach to the resulting HKWorkout.
-
instanceMethodForSelector
public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
-
instanceMethodSignatureForSelector
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
-
instancesRespondToSelector
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
-
isSubclassOfClass
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
-
keyPathsForValuesAffectingValueForKey
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
-
metadata
public NSDictionary<java.lang.String,?> metadata()
[@property] metadata The metadata that will be used when the workout is finished.
-
new_objc
public static java.lang.Object new_objc()
-
resolveClassMethod
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
-
resolveInstanceMethod
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
-
seriesBuilderForType
public HKSeriesBuilder seriesBuilderForType(HKSeriesType seriesType)
seriesBuilderForType: Retrieves the associated series builder for the specified type. Retrieves, and creates if it does not already exist, the series builder for the specified type. The series constructed with the returned builder will be associated with the workout when it is finished.- Parameters:
seriesType- The series type for which the builder should be retrieved.
-
setVersion_static
public static void setVersion_static(long aVersion)
-
startDate
public NSDate startDate()
[@property] startDate The start date for the workout, as provided by beginCollectionWithStartDate:completion:
-
statisticsForType
public HKStatistics statisticsForType(HKQuantityType quantityType)
statisticsForType: Returns an HKStatistics object containing the statistics for all the samples of the given type that have been added to the receiver. If there are no samples of the given type then nil is returned.- Parameters:
quantityType- The quantity type to gather statistics about.
-
superclass_static
public static org.moe.natj.objc.Class superclass_static()
-
version_static
public static long version_static()
-
workoutConfiguration
public HKWorkoutConfiguration workoutConfiguration()
[@property] workoutConfiguration The configuration for the workout being built.
-
workoutEvents
public NSArray<? extends HKWorkoutEvent> workoutEvents()
[@property] workoutEvents Workout events that have been added to the builder. New events that are added using addWorkoutEvents:completion: will be appended to this array once the completion is called.
-
-