Class UnaryMaskedTupleMemory<Timestamp extends java.lang.Comparable<Timestamp>>

  • All Implemented Interfaces:
    Clearable, MaskedResumable<Timestamp>, Resumable<Timestamp>

    public final class UnaryMaskedTupleMemory<Timestamp extends java.lang.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 Detail

      • keyPosition

        protected final int keyPosition
    • Constructor Detail

      • UnaryMaskedTupleMemory

        public UnaryMaskedTupleMemory​(TupleMask mask,
                                      CollectionsFactory.MemoryType bucketType,
                                      java.lang.Object owner)
        Parameters:
        mask - The mask used to index the matchings
        owner - the object "owning" this memory
        bucketType - the kind of tuple collection maintained for each indexer bucket
        Since:
        2.0
    • Method Detail

      • clear

        public void clear()
        Description copied from interface: Clearable
        Clear all partial matchings stored in memory
      • getTotalSize

        public int getTotalSize()
        Specified by:
        getTotalSize in class MaskedTupleMemory<Timestamp extends java.lang.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.

      • remove

        public boolean remove​(Tuple tuple,
                              Tuple signature)
        Description copied from class: MaskedTupleMemory
        Removes a tuple occurrence from the memory with the given signature.
        Overrides:
        remove in class MaskedTupleMemory<Timestamp extends java.lang.Comparable<Timestamp>>
        Parameters:
        tuple - the tuple to be removed from the memory
        signature - 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

        public boolean remove​(Tuple tuple)
        Description copied from class: MaskedTupleMemory
        Removes a tuple occurrence from the memory.
        Overrides:
        remove in class MaskedTupleMemory<Timestamp extends java.lang.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

        public boolean add​(Tuple tuple,
                           Tuple signature)
        Description copied from class: MaskedTupleMemory
        Adds a tuple occurrence to the memory with the given signature.
        Overrides:
        add in class MaskedTupleMemory<Timestamp extends java.lang.Comparable<Timestamp>>
        Parameters:
        tuple - the tuple to be added to the memory
        signature - precomputed footprint of the tuple according to the mask
        Returns:
        true if new signature encountered (according to the mask)
      • add

        public boolean add​(Tuple tuple)
        Description copied from class: MaskedTupleMemory
        Adds a tuple occurrence to the memory.
        Overrides:
        add in class MaskedTupleMemory<Timestamp extends java.lang.Comparable<Timestamp>>
        Parameters:
        tuple - the tuple to be added to the memory
        Returns:
        true if new signature encountered (according to the mask)
      • addInternal

        protected boolean addInternal​(Tuple tuple,
                                      java.lang.Object key)
      • removeInternal

        protected boolean removeInternal​(Tuple tuple,
                                         java.lang.Object key)