Package org.archive.util.fingerprint
Class LongFPSetCache
java.lang.Object
org.archive.util.AbstractLongFPSet
org.archive.util.fingerprint.MemLongFPSet
org.archive.util.fingerprint.LongFPSetCache
- All Implemented Interfaces:
Serializable
,LongFPSet
public class LongFPSetCache extends MemLongFPSet
Like a MemLongFPSet, but with fixed capacity and maximum size.
When an add would expand past the maximum size, an old entry
is deleted via a clock/counter algorithm.
- Author:
- gojomo
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class org.archive.util.fingerprint.MemLongFPSet
slots, values
Fields inherited from class org.archive.util.AbstractLongFPSet
capacityPowerOfTwo, count, EMPTY, loadFactor
-
Constructor Summary
Constructors Constructor Description LongFPSetCache()
LongFPSetCache(int capacityPowerOfTwo, float loadFactor)
-
Method Summary
Modifier and Type Method Description protected void
makeSpace()
Make additional space to keep the load under the target loadFactor level.protected void
noteAccess(long index)
Methods inherited from class org.archive.util.fingerprint.MemLongFPSet
clearAt, getAt, getSlotState, quickContains, relocate, setAt
Methods inherited from class org.archive.util.AbstractLongFPSet
add, contains, count, remove, removeAt
-
Constructor Details
-
LongFPSetCache
public LongFPSetCache() -
LongFPSetCache
public LongFPSetCache(int capacityPowerOfTwo, float loadFactor)
-
-
Method Details
-
noteAccess
protected void noteAccess(long index) -
makeSpace
protected void makeSpace()Description copied from class:AbstractLongFPSet
Make additional space to keep the load under the target loadFactor level. Subclasses may grow or discard entries to satisfy.- Overrides:
makeSpace
in classMemLongFPSet
-