Class YLongSet
- java.lang.Object
-
- de.hybris.platform.util.collections.fast.YLongSet
-
public class YLongSet extends java.lang.ObjectSet that can hold long primitives.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(long value)Adds element to the set.booleancontains(long value)Checks if given elements is in the set.booleanequals(java.lang.Object obj)inthashCode()booleanisEmpty()Checks if the set is empty.booleanremove(long value)Removes given element from the set.intsize()Returns number of elements in the set.long[]toArray()Gets all elements from the set as an array.
-
-
-
Method Detail
-
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
trueif this set changed otherwisefalseis 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
trueif this set changed otherwisefalseis returned
-
isEmpty
public boolean isEmpty()
Checks if the set is empty.- Returns:
trueif the set is empty,falseif 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:
trueif value is in the set orfalseotherwise
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-