Interface LongPairSet
-
- All Known Implementing Classes:
ConcurrentLongPairSet,ConcurrentSortedLongPairSet
public interface LongPairSetHash set where values are composed of pairs of longs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceLongPairSet.LongPairFunction<T>Represents a function that accepts two long arguments and produces a result.static interfaceLongPairSet.LongPairPredicatePredicate to checks for a key-value pair where both of them have long types.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadd(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.java.util.Set<ConcurrentLongPairSet.LongPair>items()java.util.Set<ConcurrentLongPairSet.LongPair>items(int numberOfItems)<T> java.util.Set<T>items(int numberOfItems, LongPairSet.LongPairFunction<T> longPairConverter)booleanremove(long item1, long item2)Removes composite value of item1 and item2 from set.intremoveIf(LongPairSet.LongPairPredicate filter)Removes composite value of item1 and item2 from set if provided predicateLongPairSet.LongPairPredicatematches.longsize()Returns size of the set.
-
-
-
Method Detail
-
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
int removeIf(LongPairSet.LongPairPredicate filter)
Removes composite value of item1 and item2 from set if provided predicateLongPairSet.LongPairPredicatematches.- Parameters:
filter-- Returns:
-
forEach
void forEach(ConcurrentLongPairSet.LongPairConsumer processor)
ExecuteConcurrentLongPairSet.LongPairConsumerprocessor for each entry in the set.- Parameters:
processor-
-
items
java.util.Set<ConcurrentLongPairSet.LongPair> items()
- Returns:
- a new list of all keys (makes a copy)
-
items
java.util.Set<ConcurrentLongPairSet.LongPair> items(int numberOfItems)
- Returns:
- a new list of keys with max provided numberOfItems (makes a copy)
-
items
<T> java.util.Set<T> items(int numberOfItems, LongPairSet.LongPairFunction<T> longPairConverter)- 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:
-
-