CharBag, MutableCharBag, CharIterable, MutableCharCollection, PrimitiveIterablepublic final class SynchronizedCharBag extends AbstractSynchronizedCharCollection implements MutableCharBag
MutableCharBag. It is imperative that the user manually synchronize on the collection when iterating over it using the
CharIterator, as per Collections.synchronizedCollection(Collection).
This file was automatically generated from template file synchronizedPrimitiveBag.stg.
MutableCharBag.asSynchronized(),
MutableBag.asSynchronized(),
Serialized Form| Constructor | Description |
|---|---|
SynchronizedCharBag(MutableCharBag bag) |
|
SynchronizedCharBag(MutableCharBag bag,
java.lang.Object newLock) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addOccurrences(char item,
int occurrences) |
|
LazyCharIterable |
asLazy() |
Returns a LazyCharIterable adapter wrapping the source CharIterable.
|
MutableCharBag |
asSynchronized() |
|
MutableCharBag |
asUnmodifiable() |
|
MutableList<CharIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
<V> MutableBag<V> |
collect(CharToObjectFunction<? extends V> function) |
Returns a new collection with the results of applying the specified function on each element of the source
collection.
|
boolean |
equals(java.lang.Object otherBag) |
Follows the same general contract as
Bag.equals(Object). |
void |
forEachWithOccurrences(CharIntProcedure 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(char item) |
The occurrences of a distinct item in the bag.
|
MutableCharBag |
reject(CharPredicate predicate) |
Returns a new CharIterable with all of the elements in the CharIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(char item,
int occurrences) |
|
MutableCharBag |
select(CharPredicate predicate) |
Returns a new CharIterable with all of the elements in the CharIterable that
return true for the specified predicate.
|
MutableCharBag |
selectByOccurrences(IntPredicate predicate) |
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
int |
sizeDistinct() |
The size of the Bag when counting only distinct elements.
|
ImmutableCharBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<CharIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
SynchronizedCharBag |
with(char element) |
|
SynchronizedCharBag |
withAll(CharIterable elements) |
|
SynchronizedCharBag |
without(char element) |
|
SynchronizedCharBag |
withoutAll(CharIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, charIterator, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toStringallSatisfy, anySatisfy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reject, select, sum, summaryStatistics, toArray, toBag, toList, toSet, toSortedArray, toSortedListtapadd, addAll, addAll, charIterator, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAllappendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringpublic SynchronizedCharBag(MutableCharBag bag)
public SynchronizedCharBag(MutableCharBag bag, java.lang.Object newLock)
public SynchronizedCharBag with(char element)
with in interface MutableCharBagwith in interface MutableCharCollectionwith in class AbstractSynchronizedCharCollectionpublic SynchronizedCharBag without(char element)
without in interface MutableCharBagwithout in interface MutableCharCollectionwithout in class AbstractSynchronizedCharCollectionpublic SynchronizedCharBag withAll(CharIterable elements)
withAll in interface MutableCharBagwithAll in interface MutableCharCollectionwithAll in class AbstractSynchronizedCharCollectionpublic SynchronizedCharBag withoutAll(CharIterable elements)
withoutAll in interface MutableCharBagwithoutAll in interface MutableCharCollectionwithoutAll in class AbstractSynchronizedCharCollectionpublic void addOccurrences(char item,
int occurrences)
addOccurrences in interface MutableCharBagpublic boolean removeOccurrences(char item,
int occurrences)
removeOccurrences in interface MutableCharBagpublic int sizeDistinct()
CharBagsizeDistinct in interface CharBagpublic int occurrencesOf(char item)
CharBagoccurrencesOf in interface CharBagpublic void forEachWithOccurrences(CharIntProcedure procedure)
CharBagforEachWithOccurrences in interface CharBagpublic MutableCharBag select(CharPredicate predicate)
CharIterableselect in interface CharBagselect in interface CharIterableselect in interface MutableCharBagselect in interface MutableCharCollectionselect in class AbstractSynchronizedCharCollectionpublic MutableCharBag selectByOccurrences(IntPredicate predicate)
MutableCharBagselectByOccurrences in interface CharBagselectByOccurrences in interface MutableCharBagpublic MutableList<CharIntPair> topOccurrences(int count)
MutableCharBagcount most frequently occurring items.
In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last
item will be returned.topOccurrences in interface CharBagtopOccurrences in interface MutableCharBagpublic MutableList<CharIntPair> bottomOccurrences(int count)
MutableCharBagcount least frequently occurring items.
In the event of a tie, all of the items with the number of occurrences that match the occurrences of the last
item will be returned.bottomOccurrences in interface CharBagbottomOccurrences in interface MutableCharBagpublic MutableCharBag reject(CharPredicate predicate)
CharIterablereject in interface CharBagreject in interface CharIterablereject in interface MutableCharBagreject in interface MutableCharCollectionreject in class AbstractSynchronizedCharCollectionpublic <V> MutableBag<V> collect(CharToObjectFunction<? extends V> function)
CharIterablecollect in interface CharBagcollect in interface CharIterablecollect in interface MutableCharBagcollect in interface MutableCharCollectioncollect in class AbstractSynchronizedCharCollectionpublic boolean equals(java.lang.Object otherBag)
CharBagBag.equals(Object).public int hashCode()
CharBagBag.hashCode().public LazyCharIterable asLazy()
CharIterableasLazy in interface CharIterableasLazy in class AbstractSynchronizedCharCollectionpublic MutableCharBag asUnmodifiable()
asUnmodifiable in interface MutableCharBagasUnmodifiable in interface MutableCharCollectionasUnmodifiable in class AbstractSynchronizedCharCollectionpublic MutableCharBag asSynchronized()
asSynchronized in interface MutableCharBagasSynchronized in interface MutableCharCollectionasSynchronized in class AbstractSynchronizedCharCollectionpublic ImmutableCharBag toImmutable()
MutableCharBagtoImmutable in interface CharBagtoImmutable in interface MutableCharBagtoImmutable in interface MutableCharCollectiontoImmutable in class AbstractSynchronizedCharCollectionCopyright © 2004–2018. All rights reserved.