Skip to content

Package: ShiftList

ShiftList

Coverage

1: package de.fhdw.gaming.memory;
2:
3: import java.util.List;
4: import java.util.Optional;
5:
6: /**
7: * Organises a list of Optinal doubles, allowing to set a maximum size for is.
8: */
9: public interface ShiftList {
10:
11: /**
12: * Returns the list of all recorded outcomes as Optional<Double>.
13: */
14: List<Optional<Double>> show();
15:
16: /**
17: * Determines how many outcomes can be saved in the list displyyed by the show() method.
18: * If there are too many outcomes saved this will delete the oldest outcome until
19: * the number of outcomes is equal to the length.
20: * @param length
21: */
22: void setLength(int length);
23:
24: /**
25: * Returns the number of outcomes that can be saves.
26: */
27: int getLength();
28:
29: /**
30: * Adds an outcome as Optional<Double> to the list. If the list is already full,
31: * the oldest outcome will be deleted before adding the new one.
32: * @param input
33: */
34: void push(Optional<Double> input);
35:
36: }