I'm new to Java, so I'm not sure which choice of data structure would be good here. I'll store accelerometer, gyroscope and magnetometer data (9 values) in a list, to be used later for smoothing, display and some signal processing.
My idea is to create an object MyObject
that has ten members: time stamp and the nine orientation/motion values, all of them floats. I'll then store the data in an ArrayList<MyObject>
. Is it a good idea or have I overlooked something?
The list will hold at most 100k values.
Use TreeMap for a start to improve lookup performance.
TreeMap
Note (in docs):
This implementation provides guaranteed log(n) time cost for the containsKey, get, put and remove operations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With