E - The type of the elements.public class CountingEvictor<E> extends RecencyEvictor<E>
RecencyEvictor for elements that have been added more times
than the specified number. Before an element have been added the specified
number of times, this evictor acts as RecencyEvictor with capacity 0.
So elements that should be retained when they are added are never evicted
immediately.
TODO: The records about add counts grow indefinitely, which is a memory leak.| Modifier and Type | Class and Description |
|---|---|
static class |
CountingEvictor.Builder |
protected static class |
CountingEvictor.ProtectedBuilder<B extends CountingEvictor.ProtectedBuilder<B>> |
protected class |
CountingEvictor.Stats |
stats| Modifier and Type | Method and Description |
|---|---|
void |
add(E element)
Add the provided element.
|
static CountingEvictor.Builder |
builder() |
Iterator<E> |
evict(com.google.common.base.Predicate<E> retain)
Return elements that are evicted.
|
getCapacity, setCapacity, sizeaddAndEvict, addAndEvict, evict, getStatspublic Iterator<E> evict(com.google.common.base.Predicate<E> retain)
Evictorretain returns true.public static CountingEvictor.Builder builder()
Copyright © 2011–2024 Live Ontologies Project. All rights reserved.