public final class DefaultMaskedTupleMemory extends MaskedTupleMemory
Modifier and Type | Field and Description |
---|---|
protected IMultiLookup<Tuple,Tuple> |
signatureToTuples
Maps a signature tuple to the bucket of tuples with the given signature.
|
mask, owner
Modifier and Type | Method and Description |
---|---|
boolean |
add(Tuple tuple)
Adds a tuple occurrence to the memory
|
boolean |
add(Tuple tuple,
Tuple signature)
Adds a tuple occurrence to the memory, with given signature
|
void |
clear()
Clear all partial matchings stored in memory
|
java.util.Collection<Tuple> |
get(ITuple signature)
Retrieves tuples that have the specified signature
|
int |
getKeysetSize() |
java.lang.Iterable<Tuple> |
getSignatures()
Retrieves a read-only view of exactly those signatures for which at least one tuple is stored
|
int |
getTotalSize() |
java.util.Iterator<Tuple> |
iterator()
Iterates over distinct tuples stored in the memory, regardless of their signatures.
|
boolean |
remove(Tuple tuple)
Removes a tuple occurrence from the memory
|
boolean |
remove(Tuple tuple,
Tuple signature)
Removes a tuple occurrence from the memory, with given signature
|
create, getMask, getOrEmpty, getOwner, raiseDuplicateDeletion, raiseDuplicateInsertion, toString
protected IMultiLookup<Tuple,Tuple> signatureToTuples
public boolean add(Tuple tuple)
MaskedTupleMemory
add
in class MaskedTupleMemory
tuple
- new tuple added to the memorypublic boolean add(Tuple tuple, Tuple signature)
MaskedTupleMemory
add
in class MaskedTupleMemory
tuple
- new tuple added to the memorysignature
- precomputed footprint of the tuple according to the maskpublic boolean remove(Tuple tuple)
MaskedTupleMemory
remove
in class MaskedTupleMemory
tuple
- old tuple removed from the memorypublic boolean remove(Tuple tuple, Tuple signature)
MaskedTupleMemory
remove
in class MaskedTupleMemory
tuple
- old tuple removed from the memorysignature
- precomputed footprint of the tuple according to the maskpublic java.util.Collection<Tuple> get(ITuple signature)
MaskedTupleMemory
get
in class MaskedTupleMemory
public void clear()
Clearable
public java.lang.Iterable<Tuple> getSignatures()
MaskedTupleMemory
getSignatures
in class MaskedTupleMemory
public java.util.Iterator<Tuple> iterator()
MaskedTupleMemory
iterator
in interface java.lang.Iterable<Tuple>
iterator
in class MaskedTupleMemory
public int getTotalSize()
getTotalSize
in class MaskedTupleMemory
This is currently not cached but computed on demand. It is therefore not efficient, and shall only be used for debug / profiling purposes.
public int getKeysetSize()
getKeysetSize
in class MaskedTupleMemory