public class MemLongFPSet extends AbstractLongFPSet implements LongFPSet, Serializable
Modifier and Type | Field and Description |
---|---|
protected byte[] |
slots |
protected long[] |
values |
capacityPowerOfTwo, count, EMPTY, loadFactor
Constructor and Description |
---|
MemLongFPSet() |
MemLongFPSet(int capacityPowerOfTwo,
float loadFactor) |
Modifier and Type | Method and Description |
---|---|
protected void |
clearAt(long index) |
protected long |
getAt(long i)
Get the stored value at the given slot.
|
protected int |
getSlotState(long i)
Check the state of a slot in the storage.
|
protected void |
makeSpace()
Make additional space to keep the load under the target
loadFactor level.
|
boolean |
quickContains(long fp)
Low-cost, non-definitive (except when true) contains
test.
|
protected void |
relocate(long val,
long oldIndex,
long newIndex) |
protected void |
setAt(long i,
long val)
Set the stored value at the given slot.
|
add, contains, count, remove, removeAt
public MemLongFPSet()
public MemLongFPSet(int capacityPowerOfTwo, float loadFactor)
capacityPowerOfTwo
- The capacity as the exponent of a power of 2.
e.g if the capacity is 4
this means 2^^4
entries.loadFactor
- The load factor as a fraction. This gives the amount
of free space to keep in the Set.protected void setAt(long i, long val)
AbstractLongFPSet
setAt
in class AbstractLongFPSet
i
- the slot indexval
- the value to setprotected long getAt(long i)
AbstractLongFPSet
getAt
in class AbstractLongFPSet
i
- the slot indexprotected void makeSpace()
AbstractLongFPSet
makeSpace
in class AbstractLongFPSet
protected void relocate(long val, long oldIndex, long newIndex)
relocate
in class AbstractLongFPSet
protected int getSlotState(long i)
AbstractLongFPSet
getSlotState
in class AbstractLongFPSet
i
- the index of the slot to checkprotected void clearAt(long index)
clearAt
in class AbstractLongFPSet
public boolean quickContains(long fp)
AbstractLongFPSet
quickContains
in interface LongFPSet
quickContains
in class AbstractLongFPSet
fp
- the fingerprint to check fortrue
if contains the fingerprintLongFPSet.quickContains(long)
Copyright © 2003-2014 Internet Archive. All Rights Reserved.