Repository navigation
Data Structure
The ObjectCluster and Property Cluster class describes the data structure used within this library. The data structure is used to encapsulate data from the driver. The ObjectCluster is made up of a MultiMap (PropertyCluster) where each key represents a Property (e.g. Accelerometer X) and each value the FormatCluster of that property. The FormatCluster is an object which holds the format (e.g. Calibrated), units and data of the property.
This design was chosen to allow properties such as Linear Acceleration and orientation to be included easily in the future along with new formats such as filtered (low pass, high pass, etc). Through the use of MultiMaps, properties within the data structure can be found easily. More information on MultiMaps can be found here.
The arrays data structure was added as an alternative to the default Multimap data structure, for the purpose of improving packet reception rate performance on lower-end Android devices. The arrays data structure is disabled by default, and can be enabled/disabled using the following code:
shimmer.enableArraysDataStructure(true)
It is recommended that users only enable this if they are having issues with packet reception rate.