Class MultiBinaryLongMap.AbstractDelegateBinaryLongMap

    • Field Detail

      • f_blm

        protected final BinaryLongMap f_blm
        The BinaryLongMap to delegate storage of this BinaryLongMap's keys to.
      • m_iIndex

        protected int m_iIndex
        The index into the LongStorage.
    • Constructor Detail

      • AbstractDelegateBinaryLongMap

        public AbstractDelegateBinaryLongMap​(BinaryLongMap blm,
                                             MultiBinaryLongMap.LongStorage store,
                                             int iIndex)
        Construct an AbstractDelegateBinaryLongMap based on the specified key tree, long storage, and storage index.
        Parameters:
        blm - the BinaryLongMap holding the keys
        store - the long storage
        iIndex - the storage index
    • Method Detail

      • get

        public long get​(Binary binKey)
        Find the specified key in the map and return the value associated with it.
        Specified by:
        get in interface BinaryLongMap
        Parameters:
        binKey - a Binary key
        Returns:
        the value associated with the specified key, or 0L if the specified key is not in the map
      • internKeys

        public void internKeys​(Object o)
        Internal opaque method: De-duplicate keys.
        Specified by:
        internKeys in interface BinaryLongMap
        Parameters:
        o - some implementation-specific object
      • keys

        public Iterator<Binary> keys()
        Obtain an iterator of the keys stored in the map.
        Specified by:
        keys in interface BinaryLongMap
        Returns:
        an Iterator of Binary keys
      • visit

        public void visit​(Binary binKey,
                          BinaryLongMap.EntryVisitor visitor)
        Apply the specified visitor to the entry associated with the specified key, if the entry exists or may be added. The visited entry may or may not logically exist in the BinaryLongMap (e.g. it may be associated with a value of 0L) but is guaranteed to be safe to be added or removed (via BinaryLongMap.Entry.setValue(long)).
        Specified by:
        visit in interface BinaryLongMap
        Parameters:
        binKey - the key to visit
        visitor - the visitor to apply
      • getIndex

        protected int getIndex()
        Determine the index into the LongStorage that this DelegatingBinaryLongMap is assigned.
        Returns:
        the index into the LongStorage
      • setIndex

        protected void setIndex​(int iIndex)
        Set the index into the LongStorage assigned to this DelegatingBinaryLongMap.
        Parameters:
        iIndex - the index into the LongStorage
      • getSlot

        protected int getSlot​(Binary binKey)
        Return the slot index associated with the specified key.
        Parameters:
        binKey - the key to return the slot for
        Returns:
        the slot index associated with the specified key
      • updateValue

        protected boolean updateValue​(int iSlot,
                                      long lValueOld,
                                      long lValueNew,
                                      boolean fForce)
        Associate the passed value with the specified key, optionally performing the operation only if the value currently associated with the key matches the passed "old" value.
        Parameters:
        iSlot - the slot whose value to update
        lValueOld - the value that is assumed to be currently associated with the key
        lValueNew - the value to associate with the key
        fForce - true iff the value should be associated regardless of the old value
        Returns:
        if fForce is true, then the return value is true iff an item was added as the result of this operation; if fForce is false, then the return value is true iff the operation affected a change to the BinaryLongMap