Interface LongPairSet
- All Known Implementing Classes:
ConcurrentLongPairSet
,ConcurrentSortedLongPairSet
public interface LongPairSet
Hash set where values are composed of pairs of longs.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents a function that accepts two long arguments and produces a result.static interface
Predicate to checks for a key-value pair where both of them have long types. -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(long item1, long item2) Adds composite value of item1 and item2 to set.long
capacity()
Returns capacity of the set.void
clear()
Removes all items from set.boolean
contains
(long item1, long item2) Checks if given (item1,item2) composite value exists into set.void
forEach
(ConcurrentLongPairSet.LongPairConsumer processor) ExecuteConcurrentLongPairSet.LongPairConsumer
processor for each entry in the set.boolean
isEmpty()
Check if set is empty.items()
items
(int numberOfItems) <T> Set<T>
items
(int numberOfItems, LongPairSet.LongPairFunction<T> longPairConverter) boolean
remove
(long item1, long item2) Removes composite value of item1 and item2 from set.int
Removes composite value of item1 and item2 from set if provided predicateLongPairSet.LongPairPredicate
matches.long
size()
Returns size of the set.
-
Method Details
-
add
boolean add(long item1, long item2) Adds composite value of item1 and item2 to set.- Parameters:
item1
-item2
-- Returns:
-
remove
boolean remove(long item1, long item2) Removes composite value of item1 and item2 from set.- Parameters:
item1
-item2
-- Returns:
-
removeIf
Removes composite value of item1 and item2 from set if provided predicateLongPairSet.LongPairPredicate
matches.- Parameters:
filter
-- Returns:
-
forEach
ExecuteConcurrentLongPairSet.LongPairConsumer
processor for each entry in the set.- Parameters:
processor
-
-
items
Set<ConcurrentLongPairSet.LongPair> items()- Returns:
- a new list of all keys (makes a copy)
-
items
- Returns:
- a new list of keys with max provided numberOfItems (makes a copy)
-
items
- Parameters:
numberOfItems
-longPairConverter
- converts (long,long) pair toobject - Returns:
- a new list of keys with max provided numberOfItems
-
isEmpty
boolean isEmpty()Check if set is empty.- Returns:
-
clear
void clear()Removes all items from set. -
size
long size()Returns size of the set.- Returns:
-
capacity
long capacity()Returns capacity of the set.- Returns:
-
contains
boolean contains(long item1, long item2) Checks if given (item1,item2) composite value exists into set.- Parameters:
item1
-item2
-- Returns:
-