public class ConcurrentLongPairSet extends Object
(long,long)
Provides similar methods as a ConcurrentHashSet
Values MUST be >= 0.
| Modifier and Type | Class and Description |
|---|---|
static interface |
ConcurrentLongPairSet.ConsumerLong |
static class |
ConcurrentLongPairSet.LongPair |
static interface |
ConcurrentLongPairSet.LongPairConsumer |
static interface |
ConcurrentLongPairSet.LongPairPredicate |
| Constructor and Description |
|---|
ConcurrentLongPairSet() |
ConcurrentLongPairSet(int expectedItems) |
ConcurrentLongPairSet(int expectedItems,
int concurrencyLevel) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(long item1,
long item2) |
long |
capacity() |
void |
clear() |
boolean |
contains(long item1,
long item2) |
void |
forEach(ConcurrentLongPairSet.LongPairConsumer processor) |
boolean |
isEmpty() |
Set<ConcurrentLongPairSet.LongPair> |
items() |
Set<ConcurrentLongPairSet.LongPair> |
items(int numberOfItems) |
boolean |
remove(long item1,
long item2)
Remove an existing entry if found
|
int |
removeIf(ConcurrentLongPairSet.LongPairPredicate filter)
Removes all of the elements of this collection that satisfy the given predicate.
|
long |
size() |
String |
toString() |
public ConcurrentLongPairSet()
public ConcurrentLongPairSet(int expectedItems)
public ConcurrentLongPairSet(int expectedItems,
int concurrencyLevel)
public long size()
public long capacity()
public boolean isEmpty()
public boolean contains(long item1,
long item2)
public boolean add(long item1,
long item2)
public boolean remove(long item1,
long item2)
item1 - public void clear()
public void forEach(ConcurrentLongPairSet.LongPairConsumer processor)
public int removeIf(ConcurrentLongPairSet.LongPairPredicate filter)
filter - a predicate which returns true for elements to be removedtrue if any elements were removedpublic Set<ConcurrentLongPairSet.LongPair> items()
public Set<ConcurrentLongPairSet.LongPair> items(int numberOfItems)
Copyright © 2017–2018 Apache Software Foundation. All rights reserved.