java.io.Externalizable, java.io.Serializable, CharBag, MutableCharBag, CharIterable, MutableCharCollection, PrimitiveIterablepublic class CharHashBag extends AbstractCharIterable implements MutableCharBag, java.io.Externalizable
HashBag, and is memory-optimized for char primitives.
This file was automatically generated from template file primitiveHashBag.stg.| Constructor | Description |
|---|---|
CharHashBag() |
|
CharHashBag(char... elements) |
|
CharHashBag(int size) |
|
CharHashBag(CharIterable iterable) |
|
CharHashBag(CharHashBag bag) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(char item) |
|
boolean |
addAll(char... source) |
|
boolean |
addAll(CharIterable source) |
|
void |
addOccurrences(char item,
int occurrences) |
|
boolean |
allSatisfy(CharPredicate predicate) |
Returns true if all of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
anySatisfy(CharPredicate predicate) |
Returns true if any of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
void |
appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end) |
Prints a string representation of this collection onto the given
Appendable. |
MutableCharBag |
asSynchronized() |
|
MutableCharBag |
asUnmodifiable() |
|
MutableList<CharIntPair> |
bottomOccurrences(int count) |
Returns the
count least frequently occurring items. |
MutableCharIterator |
charIterator() |
Returns a primitive iterator that can be used to iterate over the CharIterable in an
imperative style.
|
RichIterable<CharIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<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 |
contains(char value) |
Returns true if the value is contained in the CharIterable, and false if it is not.
|
int |
count(CharPredicate predicate) |
Returns a count of the number of elements in the CharIterable that return true for the
specified predicate.
|
char |
detectIfNone(CharPredicate predicate,
char ifNone) |
|
void |
each(CharProcedure procedure) |
A synonym for forEach.
|
boolean |
equals(java.lang.Object otherBag) |
Follows the same general contract as
Bag.equals(Object). |
void |
forEach(CharProcedure procedure) |
Applies the CharProcedure to each element in the CharIterable.
|
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(). |
<T> T |
injectInto(T injectedValue,
ObjectCharToObjectFunction<? super T,? extends T> function) |
|
boolean |
isEmpty() |
Returns true if this iterable has zero items.
|
char |
max() |
|
char |
min() |
|
static CharHashBag |
newBag(int size) |
|
static CharHashBag |
newBag(CharBag source) |
|
static CharHashBag |
newBag(CharIterable source) |
|
static CharHashBag |
newBagWith(char... source) |
|
CharHashBag |
newEmpty() |
Creates a new empty CharHashBag.
|
boolean |
noneSatisfy(CharPredicate predicate) |
Returns true if none of the elements in the CharIterable return true for the
specified predicate, otherwise returns false.
|
boolean |
notEmpty() |
The English equivalent of !this.isEmpty()
|
int |
occurrencesOf(char item) |
The occurrences of a distinct item in the bag.
|
void |
readExternal(java.io.ObjectInput in) |
|
CharHashBag |
reject(CharPredicate predicate) |
Returns a new CharIterable with all of the elements in the CharIterable that
return false for the specified predicate.
|
boolean |
remove(char item) |
|
boolean |
removeAll(char... source) |
|
boolean |
removeAll(CharIterable source) |
|
boolean |
removeIf(CharPredicate predicate) |
|
boolean |
removeOccurrences(char item,
int occurrences) |
|
boolean |
retainAll(char... source) |
|
boolean |
retainAll(CharIterable source) |
|
CharHashBag |
select(CharPredicate predicate) |
Returns a new CharIterable with all of the elements in the CharIterable that
return true for the specified predicate.
|
CharHashBag |
selectByOccurrences(IntPredicate predicate) |
Returns all elements of the bag that have a number of occurrences that satisfy the predicate.
|
MutableCharSet |
selectUnique() |
Returns all elements of the bag that have exactly one occurrence.
|
int |
size() |
Returns the number of items in this iterable.
|
int |
sizeDistinct() |
The size of the Bag when counting only distinct elements.
|
long |
sum() |
|
char[] |
toArray() |
Converts the CharIterable to a primitive char array.
|
ImmutableCharBag |
toImmutable() |
Returns an immutable copy of this bag.
|
MutableList<CharIntPair> |
topOccurrences(int count) |
Returns the
count most frequently occurring items. |
CharHashBag |
with(char element) |
|
CharHashBag |
with(char element1,
char element2) |
|
CharHashBag |
with(char element1,
char element2,
char element3) |
|
CharHashBag |
withAll(CharIterable iterable) |
|
CharHashBag |
without(char element) |
|
CharHashBag |
withoutAll(CharIterable iterable) |
|
void |
writeExternal(java.io.ObjectOutput out) |
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringtoStringOfItemToCountasLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, flatCollect, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedListselectDuplicates, tapappendString, appendString, makeString, makeString, makeString, toStringpublic CharHashBag()
public CharHashBag(int size)
public CharHashBag(CharIterable iterable)
public CharHashBag(char... elements)
public CharHashBag(CharHashBag bag)
public static CharHashBag newBag(int size)
public static CharHashBag newBagWith(char... source)
public static CharHashBag newBag(CharIterable source)
public static CharHashBag newBag(CharBag source)
public boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic int sizeDistinct()
CharBagsizeDistinct in interface CharBagpublic void clear()
clear in interface MutableCharCollectionpublic CharHashBag with(char element)
with in interface MutableCharBagwith in interface MutableCharCollectionpublic CharHashBag with(char element1, char element2)
public CharHashBag with(char element1, char element2, char element3)
public CharHashBag withAll(CharIterable iterable)
withAll in interface MutableCharBagwithAll in interface MutableCharCollectionpublic CharHashBag without(char element)
without in interface MutableCharBagwithout in interface MutableCharCollectionpublic CharHashBag withoutAll(CharIterable iterable)
withoutAll in interface MutableCharBagwithoutAll in interface MutableCharCollectionpublic boolean contains(char value)
CharIterablecontains in interface CharIterablepublic int occurrencesOf(char item)
CharBagoccurrencesOf in interface CharBagpublic void forEachWithOccurrences(CharIntProcedure procedure)
CharBagforEachWithOccurrences in interface CharBagpublic CharHashBag selectByOccurrences(IntPredicate predicate)
MutableCharBagselectByOccurrences in interface CharBagselectByOccurrences in interface MutableCharBagpublic MutableCharSet selectUnique()
MutableCharBagselectUnique in interface CharBagselectUnique 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 boolean add(char item)
add in interface MutableCharCollectionpublic boolean remove(char item)
remove in interface MutableCharCollectionpublic boolean removeIf(CharPredicate predicate)
removeIf in interface MutableCharCollectionpublic boolean addAll(char... source)
addAll in interface MutableCharCollectionpublic boolean addAll(CharIterable source)
addAll in interface MutableCharCollectionpublic boolean removeAll(char... source)
removeAll in interface MutableCharCollectionpublic boolean removeAll(CharIterable source)
removeAll in interface MutableCharCollectionpublic boolean retainAll(CharIterable source)
retainAll in interface MutableCharCollectionCollection.retainAll(Collection)public boolean retainAll(char... source)
retainAll in interface MutableCharCollectionCollection.retainAll(Collection)public void addOccurrences(char item,
int occurrences)
addOccurrences in interface MutableCharBagpublic boolean removeOccurrences(char item,
int occurrences)
removeOccurrences in interface MutableCharBagpublic void forEach(CharProcedure procedure)
CharIterableforEach in interface CharIterablepublic void each(CharProcedure procedure)
CharIterableeach in interface CharIterablepublic CharHashBag select(CharPredicate predicate)
CharIterableselect in interface CharBagselect in interface CharIterableselect in interface MutableCharBagselect in interface MutableCharCollectionpublic CharHashBag reject(CharPredicate predicate)
CharIterablereject in interface CharBagreject in interface CharIterablereject in interface MutableCharBagreject in interface MutableCharCollectionpublic <T> T injectInto(T injectedValue,
ObjectCharToObjectFunction<? super T,? extends T> function)
injectInto in interface CharIterablepublic RichIterable<CharIterable> chunk(int size)
CharIterablechunk in interface CharIterablesize - the number of elements per chunkRichIterable containing CharIterables of size size, except the last will be
truncated if the elements don't divide evenly.public boolean equals(java.lang.Object otherBag)
CharBagBag.equals(Object).public int hashCode()
CharBagBag.hashCode().public void appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic int count(CharPredicate predicate)
CharIterablecount in interface CharIterablepublic boolean anySatisfy(CharPredicate predicate)
CharIterableanySatisfy in interface CharIterablepublic boolean allSatisfy(CharPredicate predicate)
CharIterableallSatisfy in interface CharIterablepublic boolean noneSatisfy(CharPredicate predicate)
CharIterablenoneSatisfy in interface CharIterablepublic char detectIfNone(CharPredicate predicate, char ifNone)
detectIfNone in interface CharIterablepublic <V> MutableBag<V> collect(CharToObjectFunction<? extends V> function)
CharIterablecollect in interface CharBagcollect in interface CharIterablecollect in interface MutableCharBagcollect in interface MutableCharCollectionpublic char max()
max in interface CharIterablepublic char min()
min in interface CharIterablepublic long sum()
sum in interface CharIterablepublic char[] toArray()
CharIterabletoArray in interface CharIterablepublic MutableCharBag asUnmodifiable()
asUnmodifiable in interface MutableCharBagasUnmodifiable in interface MutableCharCollectionpublic MutableCharBag asSynchronized()
asSynchronized in interface MutableCharBagasSynchronized in interface MutableCharCollectionpublic ImmutableCharBag toImmutable()
MutableCharBagtoImmutable in interface CharBagtoImmutable in interface MutableCharBagtoImmutable in interface MutableCharCollectionpublic CharHashBag newEmpty()
newEmpty in interface MutableCharBagnewEmpty in interface MutableCharCollectionpublic MutableCharIterator charIterator()
CharIterablecharIterator in interface CharIterablecharIterator in interface MutableCharCollectionpublic void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException
readExternal in interface java.io.Externalizablejava.io.IOExceptionCopyright © 2004–2020. All rights reserved.