Class MultiBinaryLongMap.PrimaryBinaryLongMap.CompressedPrimaryBinaryLongMap

    • Constructor Detail

      • CompressedPrimaryBinaryLongMap

        public CompressedPrimaryBinaryLongMap​(BinaryLongMap blmKeyTree,
                                              ReentrantReadWriteLock rwLock)
        Construct a CompressedPrimaryBinaryLongMap.
        Parameters:
        blmKeyTree - the BinaryLongMap holding the keys for the outer MultiBinaryLongMap
        rwLock - the master ReadWriteReentrantLock
    • Method Detail

      • put

        public void put​(Binary binKey,
                        long lValue)
        Blindly store the passed value for the specified key, adding the key if it is not already in the map, or replacing the current value if the key is in the map.

        Note that associating the value zero with a key is analogous to removing the key.

        Specified by:
        put in interface BinaryLongMap
        Overrides:
        put in class MultiBinaryLongMap.SafeBinaryLongMap
        Parameters:
        binKey - the Binary key to add or update
        lValue - the value to associate with the key
      • putIfAbsent

        public boolean putIfAbsent​(Binary binKey,
                                   long lValue)
        Store the passed value for the specified key, only if the key does not currently exist in the map.

        Note that associating the value zero with a key using this method will have no effect, since were that key already present, there would be no change, and were it not present, the value zero is analogous to removing the key, which again is no change (since it is not present).

        Specified by:
        putIfAbsent in interface BinaryLongMap
        Overrides:
        putIfAbsent in class MultiBinaryLongMap.SafeBinaryLongMap
        Parameters:
        binKey - a Binary key
        lValue - the new value to associate with the passed key
        Returns:
        true iff the key was not present in the map, and now it is present in the map associated with the passed value
      • remove

        public boolean remove​(Binary binKey,
                              long lValue)
        Remove the specified Binary key from the map iff it exists in the map and is associated with the specified value.

        Note that removing an association whose value is zero has no effect.

        Specified by:
        remove in interface BinaryLongMap
        Overrides:
        remove in class MultiBinaryLongMap.SafeBinaryLongMap
        Parameters:
        binKey - a Binary key
        lValue - the value that the key must have in order to be removed
        Returns:
        true iff the map contained the key, it was associated with the specified value, and has now been removed