I have a small problem.
For example, I have ArrayList
ArrayList<Double> Temp1 = new ArrayList<>();
with size = 5 (0, 1, 2, 3, 4). I need to move the data by removing one value when comes the new value. For example, when Temp1.add(5) I have to get a result (1, 2, 3, 4, 5). Is it possible without using cycle?
Becuse In my app I have very big ArrayList
(1000-15000 elements) that is filled from connected device with 5-10 items per sec. When I use the cycle "for" to retrieve last 50 items I lost productivity and receive from device 1-2 items per sec.