java.lang.Object
de.hybris.platform.util.collections.fast.YLongSet

public class YLongSet extends Object
Set that can hold long primitives.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an empty set.
    YLongSet(int initialCapacity)
    Creates an empty set with preallocated initial space for elements.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    add(long value)
    Adds element to the set.
    boolean
    contains(long value)
    Checks if given elements is in the set.
    boolean
     
    int
     
    boolean
    Checks if the set is empty.
    boolean
    remove(long value)
    Removes given element from the set.
    int
    Returns number of elements in the set.
    long[]
    Gets all elements from the set as an array.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • YLongSet

      public YLongSet()
      Creates an empty set.
    • YLongSet

      public YLongSet(int initialCapacity)
      Creates an empty set with preallocated initial space for elements.
      Parameters:
      initialCapacity - initial capacity of the set
  • Method Details

    • size

      public int size()
      Returns number of elements in the set.
      Returns:
      number of elements in the set
    • add

      public boolean add(long value)
      Adds element to the set. Can be invoked for the same value multiple times.
      Parameters:
      value - value to add
      Returns:
      returns true if this set changed otherwise false is returned
    • remove

      public boolean remove(long value)
      Removes given element from the set. Can be invoked for values that don't exist in the set.
      Parameters:
      value - value to remove
      Returns:
      returns true if this set changed otherwise false is returned
    • isEmpty

      public boolean isEmpty()
      Checks if the set is empty.
      Returns:
      true if the set is empty, false if set contains one or more elements
    • toArray

      public long[] toArray()
      Gets all elements from the set as an array. The order of elements in the array is unspecified.
      Returns:
      array with all elements from this set
    • contains

      public boolean contains(long value)
      Checks if given elements is in the set.
      Parameters:
      value - value to test
      Returns:
      true if value is in the set or false otherwise
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object