I am writing an app that will average 4 of the last readings and I'm looking for the best method to handle the data.
I thought perhaps a MAP with indices: 1 2 3 4 where I would move the "index pointer" from 1 to 2 to 3 .....etc to write the new reading where to oldest is located. I don't want to do a running average.
As I read more about groovy is see the term "groovy way" to introduce novel approaches to different procedures. Does anyone have a suggestion that would be more efficient than the above?