Class EvictingList<V>
java.lang.Object
de.florianmichael.rclasses.pattern.evicting.EvictingList<V>
- Type Parameters:
V- The type of the list.
Implementation of an evicting list. This list will remove the first entry if the list is full.
-
Constructor Summary
ConstructorsConstructorDescriptionDummy constructor.EvictingList(List<V> list, int maxSize) Creates a new evicting list. -
Method Summary
-
Constructor Details
-
EvictingList
public EvictingList()Dummy constructor. -
EvictingList
Creates a new evicting list.- Parameters:
list- The list.maxSize- The maximum size of the list.
-
-
Method Details
-
add
Adds a value to the list. If the list is full, the first entry will be removed. Returns true if the list was full.- Parameters:
value- The value to add.- Returns:
- True if the list was full.
-
isFull
public boolean isFull()- Returns:
- True if the list is full.
-
getNormalList
-
getMaxSize
public int getMaxSize()
-