Interface LongPairSet
- All Known Implementing Classes:
ConcurrentLongPairSet,ConcurrentSortedLongPairSet
public interface LongPairSet
Hash set where values are composed of pairs of longs.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents a function that accepts two long arguments and produces a result.static interfacePredicate to checks for a key-value pair where both of them have long types. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(long item1, long item2) Adds composite value of item1 and item2 to set.longcapacity()Returns capacity of the set.voidclear()Removes all items from set.booleancontains(long item1, long item2) Checks if given (item1,item2) composite value exists into set.voidforEach(ConcurrentLongPairSet.LongPairConsumer processor) ExecuteConcurrentLongPairSet.LongPairConsumerprocessor for each entry in the set.booleanisEmpty()Check if set is empty.items()items(int numberOfItems) <T> Set<T>items(int numberOfItems, LongPairSet.LongPairFunction<T> longPairConverter) booleanremove(long item1, long item2) Removes composite value of item1 and item2 from set.intRemoves composite value of item1 and item2 from set if provided predicateLongPairSet.LongPairPredicatematches.longsize()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.LongPairPredicatematches.- Parameters:
filter-- Returns:
-
forEach
ExecuteConcurrentLongPairSet.LongPairConsumerprocessor 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:
-