Class BmLongSegmentSyncSet

  • All Implemented Interfaces:
    IBmLongSet

    public class BmLongSegmentSyncSet
    extends Object
    implements IBmLongSet
    A Long set with segment synchronization. Implementation limited only for put/get/remove operations. Iterations are not supported.
    • Field Detail

      • hashSalt

        protected final long hashSalt
    • Constructor Detail

      • BmLongSegmentSyncSet

        public BmLongSegmentSyncSet​(int segments)
    • Method Detail

      • hashSaltValue

        protected long hashSaltValue()
      • iterator

        public IBmLongIterator iterator()
        Description copied from interface: IBmLongSet
        Gets the long value iterator
        Specified by:
        iterator in interface IBmLongSet
        Returns:
        The iterator of values. May not be null
      • contains

        public boolean contains​(long key)
        Description copied from interface: IBmLongSet
        Checks if the set contains the specified element.
        Specified by:
        contains in interface IBmLongSet
        Parameters:
        key - the element.
        Returns:
        true if set contains the specified element, false otherwise.
      • add

        public void add​(long key)
        Description copied from interface: IBmLongSet
        Adds the specified element.
        Specified by:
        add in interface IBmLongSet
        Parameters:
        key - the element to add.
      • remove

        public boolean remove​(long key)
        Description copied from interface: IBmLongSet
        Removes the specified element.
        Specified by:
        remove in interface IBmLongSet
        Parameters:
        key - the element to remove.
        Returns:
        true if this set contained the specified element, false otherwise.
      • removeAll

        public void removeAll​(Set<Long> set)
      • copyKeys

        public List<Long> copyKeys()
      • size

        public int size()
        Description copied from interface: IBmLongSet
        Returns the number of elements in this set.
        Specified by:
        size in interface IBmLongSet
        Returns:
        the number of elements in this set.
      • haveItems

        public boolean haveItems()
      • addAll

        public void addAll​(IBmLongSet values)
        Description copied from interface: IBmLongSet
        Adds all the values from the specified collection.
        Specified by:
        addAll in interface IBmLongSet
        Parameters:
        values - the collection of values to add.
      • addAll

        public void addAll​(Iterable<Long> values)
        Description copied from interface: IBmLongSet
        Adds all the values from the specified collection.
        Specified by:
        addAll in interface IBmLongSet
        Parameters:
        values - the collection of values to add.
      • addAll

        public void addAll​(long[] array)
        Description copied from interface: IBmLongSet
        Adds all the values from the specified array.
        Specified by:
        addAll in interface IBmLongSet
        Parameters:
        array - the array. May not be null.
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: IBmLongSet
        Checks whether this set is empty.
        Specified by:
        isEmpty in interface IBmLongSet
        Returns:
        true if this set has no elements, false otherwise.
        See Also:
        IBmLongSet.size()
      • keys

        public Collection<Long> keys()
        Description copied from interface: IBmLongSet
        Gets collection of elements.
        Specified by:
        keys in interface IBmLongSet
        Returns:
        the collection of elements.