MutableShortBag, ShortBag, MutableShortCollection, PrimitiveIterable, ShortIterablepublic final class UnmodifiableShortBag extends AbstractUnmodifiableShortCollection implements MutableShortBag
| Constructor | Description |
|---|---|
UnmodifiableShortBag(MutableShortBag bag) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addOccurrences(short item,
int occurrences) |
|
MutableShortBag |
asSynchronized() |
|
MutableShortBag |
asUnmodifiable() |
|
MutableList<ShortIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
<V> MutableBag<V> |
collect(ShortToObjectFunction<? 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(ShortIntProcedure 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(short item) |
The occurrences of a distinct item in the bag.
|
MutableShortBag |
reject(ShortPredicate predicate) |
Returns a new ShortIterable with all of the elements in the ShortIterable that
return false for the specified predicate.
|
boolean |
removeOccurrences(short item,
int occurrences) |
|
MutableShortBag |
select(ShortPredicate predicate) |
Returns a new ShortIterable with all of the elements in the ShortIterable that
return true for the specified predicate.
|
MutableShortBag |
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.
|
ImmutableShortBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<ShortIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
UnmodifiableShortBag |
with(short element) |
|
UnmodifiableShortBag |
withAll(ShortIterable elements) |
|
UnmodifiableShortBag |
without(short element) |
|
UnmodifiableShortBag |
withoutAll(ShortIterable elements) |
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, clear, contains, containsAll, containsAll, count, detectIfNone, each, forEach, injectInto, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, remove, removeAll, removeAll, retainAll, retainAll, shortIterator, size, sum, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toStringtapadd, addAll, addAll, clear, remove, removeAll, removeAll, retainAll, retainAll, shortIteratorappendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toStringallSatisfy, anySatisfy, asLazy, 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, toSortedListpublic UnmodifiableShortBag(MutableShortBag bag)
public UnmodifiableShortBag with(short element)
with in interface MutableShortBagwith in interface MutableShortCollectionwith in class AbstractUnmodifiableShortCollectionpublic UnmodifiableShortBag without(short element)
without in interface MutableShortBagwithout in interface MutableShortCollectionwithout in class AbstractUnmodifiableShortCollectionpublic UnmodifiableShortBag withAll(ShortIterable elements)
withAll in interface MutableShortBagwithAll in interface MutableShortCollectionwithAll in class AbstractUnmodifiableShortCollectionpublic UnmodifiableShortBag withoutAll(ShortIterable elements)
withoutAll in interface MutableShortBagwithoutAll in interface MutableShortCollectionwithoutAll in class AbstractUnmodifiableShortCollectionpublic void addOccurrences(short item,
int occurrences)
addOccurrences in interface MutableShortBagpublic boolean removeOccurrences(short item,
int occurrences)
removeOccurrences in interface MutableShortBagpublic int sizeDistinct()
ShortBagsizeDistinct in interface ShortBagpublic int occurrencesOf(short item)
ShortBagoccurrencesOf in interface ShortBagpublic void forEachWithOccurrences(ShortIntProcedure procedure)
ShortBagforEachWithOccurrences in interface ShortBagpublic MutableShortBag selectByOccurrences(IntPredicate predicate)
MutableShortBagselectByOccurrences in interface MutableShortBagselectByOccurrences in interface ShortBagpublic MutableList<ShortIntPair> topOccurrences(int count)
MutableShortBagcount 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 MutableShortBagtopOccurrences in interface ShortBagpublic MutableList<ShortIntPair> bottomOccurrences(int count)
MutableShortBagcount 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 MutableShortBagbottomOccurrences in interface ShortBagpublic MutableShortBag select(ShortPredicate predicate)
ShortIterableselect in interface MutableShortBagselect in interface MutableShortCollectionselect in interface ShortBagselect in interface ShortIterableselect in class AbstractUnmodifiableShortCollectionpublic MutableShortBag reject(ShortPredicate predicate)
ShortIterablereject in interface MutableShortBagreject in interface MutableShortCollectionreject in interface ShortBagreject in interface ShortIterablereject in class AbstractUnmodifiableShortCollectionpublic <V> MutableBag<V> collect(ShortToObjectFunction<? extends V> function)
ShortIterablecollect in interface MutableShortBagcollect in interface MutableShortCollectioncollect in interface ShortBagcollect in interface ShortIterablecollect in class AbstractUnmodifiableShortCollectionpublic boolean equals(java.lang.Object otherBag)
ShortBagBag.equals(Object).public int hashCode()
ShortBagBag.hashCode().public MutableShortBag asUnmodifiable()
asUnmodifiable in interface MutableShortBagasUnmodifiable in interface MutableShortCollectionasUnmodifiable in class AbstractUnmodifiableShortCollectionpublic MutableShortBag asSynchronized()
asSynchronized in interface MutableShortBagasSynchronized in interface MutableShortCollectionasSynchronized in class AbstractUnmodifiableShortCollectionpublic ImmutableShortBag toImmutable()
MutableShortBagtoImmutable in interface MutableShortBagtoImmutable in interface MutableShortCollectiontoImmutable in interface ShortBagtoImmutable in class AbstractUnmodifiableShortCollectionCopyright © 2004–2017. All rights reserved.