@ThreadSafe public final class SynchronizedLongBag extends AbstractSynchronizedLongCollection implements MutableLongBag
MutableLongBag
. It is imperative that the user manually synchronize on the collection when iterating over it using the
LongIterator
, as per Collections.synchronizedCollection(Collection)
.
This file was automatically generated from template file synchronizedPrimitiveBag.stg.
MutableLongBag.asSynchronized()
,
MutableBag.asSynchronized()
,
Serialized FormModifier and Type | Method and Description |
---|---|
void |
addOccurrences(long item,
int occurrences) |
LazyLongIterable |
asLazy() |
MutableLongBag |
asSynchronized() |
MutableLongBag |
asUnmodifiable() |
<V> MutableBag<V> |
collect(LongToObjectFunction<? extends V> function) |
boolean |
equals(Object otherBag)
Follows the same general contract as
Bag.equals(Object) . |
void |
forEachWithOccurrences(LongIntProcedure procedure)
For each distinct item, with the number of occurrences, execute the specified procedure.
|
int |
hashCode()
Follows the same general contract as
Bag.hashCode() . |
int |
occurrencesOf(long item)
The occurrences of a distinct item in the bag.
|
MutableLongBag |
reject(LongPredicate predicate) |
boolean |
removeOccurrences(long item,
int occurrences) |
MutableLongBag |
select(LongPredicate predicate) |
int |
sizeDistinct()
The size of the Bag when counting only distinct elements.
|
ImmutableLongBag |
toImmutable()
Returns an immutable copy of this bag.
|
SynchronizedLongBag |
with(long element) |
SynchronizedLongBag |
withAll(LongIterable elements) |
SynchronizedLongBag |
without(long element) |
SynchronizedLongBag |
withoutAll(LongIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, isEmpty, longIterator, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, remove, removeAll, removeAll, retainAll, retainAll, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
add, addAll, addAll, clear, longIterator, remove, removeAll, removeAll, retainAll, retainAll
allSatisfy, anySatisfy, average, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
public SynchronizedLongBag with(long element)
with
in interface MutableLongBag
with
in interface MutableLongCollection
with
in class AbstractSynchronizedLongCollection
public SynchronizedLongBag without(long element)
without
in interface MutableLongBag
without
in interface MutableLongCollection
without
in class AbstractSynchronizedLongCollection
public SynchronizedLongBag withAll(LongIterable elements)
withAll
in interface MutableLongBag
withAll
in interface MutableLongCollection
withAll
in class AbstractSynchronizedLongCollection
public SynchronizedLongBag withoutAll(LongIterable elements)
withoutAll
in interface MutableLongBag
withoutAll
in interface MutableLongCollection
withoutAll
in class AbstractSynchronizedLongCollection
public void addOccurrences(long item, int occurrences)
addOccurrences
in interface MutableLongBag
public boolean removeOccurrences(long item, int occurrences)
removeOccurrences
in interface MutableLongBag
public int sizeDistinct()
LongBag
sizeDistinct
in interface LongBag
public int occurrencesOf(long item)
LongBag
occurrencesOf
in interface LongBag
public void forEachWithOccurrences(LongIntProcedure procedure)
LongBag
forEachWithOccurrences
in interface LongBag
public MutableLongBag select(LongPredicate predicate)
select
in interface LongBag
select
in interface MutableLongBag
select
in interface MutableLongCollection
select
in interface LongIterable
select
in class AbstractSynchronizedLongCollection
public MutableLongBag reject(LongPredicate predicate)
reject
in interface LongBag
reject
in interface MutableLongBag
reject
in interface MutableLongCollection
reject
in interface LongIterable
reject
in class AbstractSynchronizedLongCollection
public <V> MutableBag<V> collect(LongToObjectFunction<? extends V> function)
collect
in interface LongBag
collect
in interface MutableLongBag
collect
in interface MutableLongCollection
collect
in interface LongIterable
collect
in class AbstractSynchronizedLongCollection
public boolean equals(Object otherBag)
LongBag
Bag.equals(Object)
.public int hashCode()
LongBag
Bag.hashCode()
.public LazyLongIterable asLazy()
asLazy
in interface LongIterable
asLazy
in class AbstractSynchronizedLongCollection
public MutableLongBag asUnmodifiable()
asUnmodifiable
in interface MutableLongBag
asUnmodifiable
in interface MutableLongCollection
asUnmodifiable
in class AbstractSynchronizedLongCollection
public MutableLongBag asSynchronized()
asSynchronized
in interface MutableLongBag
asSynchronized
in interface MutableLongCollection
asSynchronized
in class AbstractSynchronizedLongCollection
public ImmutableLongBag toImmutable()
MutableLongBag
toImmutable
in interface LongBag
toImmutable
in interface MutableLongBag
toImmutable
in interface MutableLongCollection
toImmutable
in class AbstractSynchronizedLongCollection
Copyright © 2004–2016. All rights reserved.