Class UnaryMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>
java.lang.Object
tools.refinery.interpreter.matchers.memories.MaskedTupleMemory<Timestamp>
tools.refinery.interpreter.matchers.memories.UnaryMaskedTupleMemory<Timestamp>
- All Implemented Interfaces:
Clearable,MaskedResumable<Timestamp>,Resumable<Timestamp>
public final class UnaryMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>
extends MaskedTupleMemory<Timestamp>
Specialized for unary mask; tuples are indexed by a single column as opposed to a projection (signature) tuple.
- Since:
- 2.0
-
Field Summary
FieldsFields inherited from class tools.refinery.interpreter.matchers.memories.MaskedTupleMemory
mask, owner -
Constructor Summary
ConstructorsConstructorDescriptionUnaryMaskedTupleMemory(TupleMask mask, CollectionsFactory.MemoryType bucketType, Object owner) -
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds a tuple occurrence to the memory.booleanAdds a tuple occurrence to the memory with the given signature.protected booleanaddInternal(Tuple tuple, Object key) voidclear()Clear all partial matchings stored in memoryRetrieves tuples that have the specified signatureintRetrieves a read-only view of exactly those signatures for which at least one tuple is storedintgetWithTimeline(ITuple signature) Retrieves the tuples and their associated timelines that have the specified signature.iterator()Iterates over distinct tuples stored in the memory, regardless of their signatures.booleanRemoves a tuple occurrence from the memory.booleanRemoves a tuple occurrence from the memory with the given signature.protected booleanremoveInternal(Tuple tuple, Object key) Methods inherited from class tools.refinery.interpreter.matchers.memories.MaskedTupleMemory
addWithTimestamp, addWithTimestamp, create, create, create, getMask, getOrEmpty, getOrEmptyWithTimeline, getOwner, getResumableSignatures, getResumableTimestamp, initializeWith, isPresentAtInfinity, isTimely, raiseDuplicateDeletion, raiseDuplicateInsertion, removeWithTimestamp, removeWithTimestamp, resumeAt, toString
-
Field Details
-
columnToTuples
-
keyPosition
protected final int keyPosition
-
-
Constructor Details
-
UnaryMaskedTupleMemory
public UnaryMaskedTupleMemory(TupleMask mask, CollectionsFactory.MemoryType bucketType, Object owner) - Parameters:
mask- The mask used to index the matchingsbucketType- the kind of tuple collection maintained for each indexer bucketowner- the object "owning" this memory- Since:
- 2.0
-
-
Method Details
-
clear
public void clear()Description copied from interface:ClearableClear all partial matchings stored in memory -
getKeysetSize
public int getKeysetSize()- Specified by:
getKeysetSizein classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>- Returns:
- the number of distinct signatures of all stored tuples.
-
getTotalSize
public int getTotalSize()- Specified by:
getTotalSizein classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>- Returns:
- the total number of distinct tuples stored. Multiple copies of the same tuple, if allowed, are counted as
one.
This is currently not cached but computed on demand. It is therefore not efficient, and shall only be used for debug / profiling purposes.
-
iterator
Description copied from class:MaskedTupleMemoryIterates over distinct tuples stored in the memory, regardless of their signatures.- Specified by:
iteratorin classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>
-
getSignatures
Description copied from class:MaskedTupleMemoryRetrieves a read-only view of exactly those signatures for which at least one tuple is stored- Specified by:
getSignaturesin classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>
-
get
Description copied from class:MaskedTupleMemoryRetrieves tuples that have the specified signature- Specified by:
getin classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>- Returns:
- collection of tuples found, null if none
-
getWithTimeline
Description copied from class:MaskedTupleMemoryRetrieves the tuples and their associated timelines that have the specified signature.- Specified by:
getWithTimelinein classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>- Returns:
- the mappings from tuples to timelines, null if there is no mapping for the signature
-
remove
Description copied from class:MaskedTupleMemoryRemoves a tuple occurrence from the memory with the given signature.- Overrides:
removein classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>- Parameters:
tuple- the tuple to be removed from the memorysignature- precomputed footprint of the tuple according to the mask- Returns:
- true if this was the the last occurrence of the signature (according to the mask)
-
remove
Description copied from class:MaskedTupleMemoryRemoves a tuple occurrence from the memory.- Overrides:
removein classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>- Parameters:
tuple- the tuple to be removed from the memory- Returns:
- true if this was the the last occurrence of the signature (according to the mask)
-
add
Description copied from class:MaskedTupleMemoryAdds a tuple occurrence to the memory with the given signature.- Overrides:
addin classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>- Parameters:
tuple- the tuple to be added to the memorysignature- precomputed footprint of the tuple according to the mask- Returns:
- true if new signature encountered (according to the mask)
-
add
Description copied from class:MaskedTupleMemoryAdds a tuple occurrence to the memory.- Overrides:
addin classMaskedTupleMemory<Timestamp extends Comparable<Timestamp>>- Parameters:
tuple- the tuple to be added to the memory- Returns:
- true if new signature encountered (according to the mask)
-
addInternal
-
removeInternal
-