@NotThreadSafe public final class CharHashBag extends Object implements MutableCharBag, Externalizable
HashBag, and is memory-optimized for char primitives.
This file was automatically generated from template file primitiveHashBag.stg.| Constructor and Description |
|---|
CharHashBag() |
CharHashBag(CharHashBag bag) |
CharHashBag(CharIterable iterable) |
CharHashBag(int size) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(char item) |
boolean |
addAll(char... source) |
boolean |
addAll(CharIterable source) |
void |
addOccurrences(char item,
int occurrences) |
boolean |
allSatisfy(CharPredicate predicate) |
boolean |
anySatisfy(CharPredicate predicate) |
void |
appendString(Appendable appendable)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String separator)
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable. |
LazyCharIterable |
asLazy() |
MutableCharBag |
asSynchronized() |
MutableCharBag |
asUnmodifiable() |
double |
average() |
CharIterator |
charIterator() |
void |
clear() |
<V> MutableBag<V> |
collect(CharToObjectFunction<? extends V> function) |
boolean |
contains(char value) |
boolean |
containsAll(char... source) |
boolean |
containsAll(CharIterable source) |
int |
count(CharPredicate predicate) |
char |
detectIfNone(CharPredicate predicate,
char ifNone) |
boolean |
equals(Object otherBag)
Follows the same general contract as
Bag.equals(Object). |
void |
forEach(CharProcedure procedure) |
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.
|
String |
makeString()
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
String |
makeString(String separator)
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
String |
makeString(String start,
String separator,
String end)
Returns a string representation of this collection.
|
char |
max() |
char |
maxIfEmpty(char defaultValue) |
double |
median() |
char |
min() |
char |
minIfEmpty(char defaultValue) |
static CharHashBag |
newBag(CharBag source) |
static CharHashBag |
newBag(CharIterable source) |
static CharHashBag |
newBag(int size) |
static CharHashBag |
newBagWith(char... source) |
boolean |
noneSatisfy(CharPredicate predicate) |
boolean |
notEmpty()
The English equivalent of !this.isEmpty()
|
int |
occurrencesOf(char item)
The occurrences of a distinct item in the bag.
|
void |
readExternal(ObjectInput in) |
CharHashBag |
reject(CharPredicate predicate) |
boolean |
remove(char item) |
boolean |
removeAll(char... source) |
boolean |
removeAll(CharIterable source) |
boolean |
removeOccurrences(char item,
int occurrences) |
boolean |
retainAll(char... source) |
boolean |
retainAll(CharIterable source) |
CharHashBag |
select(CharPredicate predicate) |
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() |
MutableCharBag |
toBag() |
ImmutableCharBag |
toImmutable()
Returns an immutable copy of this bag.
|
MutableCharList |
toList() |
MutableCharSet |
toSet() |
char[] |
toSortedArray() |
MutableCharList |
toSortedList() |
String |
toString()
Returns a string representation of this PrimitiveIterable.
|
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(ObjectOutput out) |
public CharHashBag()
public CharHashBag(int size)
public CharHashBag(CharIterable iterable)
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)
contains in interface CharIterablepublic boolean containsAll(char... source)
containsAll in interface CharIterablepublic boolean containsAll(CharIterable source)
containsAll in interface CharIterablepublic int occurrencesOf(char item)
CharBagoccurrencesOf in interface CharBagpublic void forEachWithOccurrences(CharIntProcedure procedure)
CharBagforEachWithOccurrences in interface CharBagpublic boolean add(char item)
add in interface MutableCharCollectionpublic boolean remove(char item)
remove 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)
forEach in interface CharIterablepublic CharHashBag select(CharPredicate predicate)
select in interface CharBagselect in interface MutableCharBagselect in interface CharIterableselect in interface MutableCharCollectionpublic CharHashBag reject(CharPredicate predicate)
reject in interface CharBagreject in interface MutableCharBagreject in interface CharIterablereject in interface MutableCharCollectionpublic <T> T injectInto(T injectedValue,
ObjectCharToObjectFunction<? super T,? extends T> function)
injectInto in interface CharIterablepublic boolean equals(Object otherBag)
CharBagBag.equals(Object).public int hashCode()
CharBagBag.hashCode().public String toString()
PrimitiveIterabletoString in interface PrimitiveIterabletoString in class Objectpublic String makeString()
PrimitiveIterablePrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).makeString in interface PrimitiveIterablepublic String makeString(String separator)
PrimitiveIterablePrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString in interface PrimitiveIterablepublic String makeString(String start, String separator, String end)
PrimitiveIterablemakeString in interface PrimitiveIterablepublic void appendString(Appendable appendable)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString().appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String).appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic int count(CharPredicate predicate)
count in interface CharIterablepublic boolean anySatisfy(CharPredicate predicate)
anySatisfy in interface CharIterablepublic boolean allSatisfy(CharPredicate predicate)
allSatisfy in interface CharIterablepublic boolean noneSatisfy(CharPredicate predicate)
noneSatisfy in interface CharIterablepublic char detectIfNone(CharPredicate predicate, char ifNone)
detectIfNone in interface CharIterablepublic <V> MutableBag<V> collect(CharToObjectFunction<? extends V> function)
collect in interface CharBagcollect in interface MutableCharBagcollect in interface CharIterablecollect in interface MutableCharCollectionpublic char max()
max in interface CharIterablepublic char min()
min in interface CharIterablepublic long sum()
sum in interface CharIterablepublic char minIfEmpty(char defaultValue)
minIfEmpty in interface CharIterablepublic char maxIfEmpty(char defaultValue)
maxIfEmpty in interface CharIterablepublic double average()
average in interface CharIterablepublic double median()
median in interface CharIterablepublic char[] toArray()
toArray in interface CharIterablepublic char[] toSortedArray()
toSortedArray in interface CharIterablepublic MutableCharList toList()
toList in interface CharIterablepublic MutableCharList toSortedList()
toSortedList in interface CharIterablepublic MutableCharSet toSet()
toSet in interface CharIterablepublic MutableCharBag toBag()
toBag in interface CharIterablepublic LazyCharIterable asLazy()
asLazy 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 CharIterator charIterator()
charIterator in interface CharIterablepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionCopyright © 2004–2017. All rights reserved.