@NotThreadSafe public final class CharHashBag extends AbstractCharIterable implements com.gs.collections.api.bag.primitive.MutableCharBag, java.io.Externalizable
HashBag, and is memory-optimized for char primitives.
This file was automatically generated from template file primitiveHashBag.stg.| Constructor and Description |
|---|
CharHashBag() |
CharHashBag(char... elements) |
CharHashBag(CharHashBag bag) |
CharHashBag(com.gs.collections.api.CharIterable iterable) |
CharHashBag(int size) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(char item) |
boolean |
addAll(char... source) |
boolean |
addAll(com.gs.collections.api.CharIterable source) |
void |
addOccurrences(char item,
int occurrences) |
boolean |
allSatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
boolean |
anySatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
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. |
com.gs.collections.api.bag.primitive.MutableCharBag |
asSynchronized() |
com.gs.collections.api.bag.primitive.MutableCharBag |
asUnmodifiable() |
com.gs.collections.api.iterator.MutableCharIterator |
charIterator() |
void |
clear() |
<V> com.gs.collections.api.bag.MutableBag<V> |
collect(com.gs.collections.api.block.function.primitive.CharToObjectFunction<? extends V> function) |
boolean |
contains(char value) |
int |
count(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
char |
detectIfNone(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate,
char ifNone) |
void |
each(com.gs.collections.api.block.procedure.primitive.CharProcedure procedure) |
boolean |
equals(java.lang.Object otherBag)
Follows the same general contract as
Bag.equals(Object). |
void |
forEach(com.gs.collections.api.block.procedure.primitive.CharProcedure procedure) |
void |
forEachWithOccurrences(com.gs.collections.api.block.procedure.primitive.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,
com.gs.collections.api.block.function.primitive.ObjectCharToObjectFunction<? super T,? extends T> function) |
boolean |
isEmpty()
Returns true if this iterable has zero items.
|
char |
max() |
char |
min() |
static CharHashBag |
newBag(com.gs.collections.api.bag.primitive.CharBag source) |
static CharHashBag |
newBag(com.gs.collections.api.CharIterable source) |
static CharHashBag |
newBag(int size) |
static CharHashBag |
newBagWith(char... source) |
boolean |
noneSatisfy(com.gs.collections.api.block.predicate.primitive.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(java.io.ObjectInput in) |
CharHashBag |
reject(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate) |
boolean |
remove(char item) |
boolean |
removeAll(char... source) |
boolean |
removeAll(com.gs.collections.api.CharIterable source) |
boolean |
removeOccurrences(char item,
int occurrences) |
boolean |
retainAll(char... source) |
boolean |
retainAll(com.gs.collections.api.CharIterable source) |
CharHashBag |
select(com.gs.collections.api.block.predicate.primitive.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() |
com.gs.collections.api.bag.primitive.ImmutableCharBag |
toImmutable()
Returns an immutable copy of this bag.
|
CharHashBag |
with(char element) |
CharHashBag |
with(char element1,
char element2) |
CharHashBag |
with(char element1,
char element2,
char element3) |
CharHashBag |
withAll(com.gs.collections.api.CharIterable iterable) |
CharHashBag |
without(char element) |
CharHashBag |
withoutAll(com.gs.collections.api.CharIterable iterable) |
void |
writeExternal(java.io.ObjectOutput out) |
appendString, appendString, asLazy, average, containsAll, containsAll, makeString, makeString, makeString, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitpublic CharHashBag()
public CharHashBag(int size)
public CharHashBag(com.gs.collections.api.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(com.gs.collections.api.CharIterable source)
public static CharHashBag newBag(com.gs.collections.api.bag.primitive.CharBag source)
public boolean isEmpty()
com.gs.collections.api.PrimitiveIterableisEmpty in interface com.gs.collections.api.PrimitiveIterableisEmpty in class AbstractCharIterablepublic boolean notEmpty()
com.gs.collections.api.PrimitiveIterablenotEmpty in interface com.gs.collections.api.PrimitiveIterablenotEmpty in class AbstractCharIterablepublic int size()
com.gs.collections.api.PrimitiveIterablesize in interface com.gs.collections.api.PrimitiveIterablepublic int sizeDistinct()
com.gs.collections.api.bag.primitive.CharBagsizeDistinct in interface com.gs.collections.api.bag.primitive.CharBagpublic void clear()
clear in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic CharHashBag with(char element)
with in interface com.gs.collections.api.bag.primitive.MutableCharBagwith in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic CharHashBag with(char element1, char element2)
public CharHashBag with(char element1, char element2, char element3)
public CharHashBag withAll(com.gs.collections.api.CharIterable iterable)
withAll in interface com.gs.collections.api.bag.primitive.MutableCharBagwithAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic CharHashBag without(char element)
without in interface com.gs.collections.api.bag.primitive.MutableCharBagwithout in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic CharHashBag withoutAll(com.gs.collections.api.CharIterable iterable)
withoutAll in interface com.gs.collections.api.bag.primitive.MutableCharBagwithoutAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean contains(char value)
contains in interface com.gs.collections.api.CharIterablepublic int occurrencesOf(char item)
com.gs.collections.api.bag.primitive.CharBagoccurrencesOf in interface com.gs.collections.api.bag.primitive.CharBagpublic void forEachWithOccurrences(com.gs.collections.api.block.procedure.primitive.CharIntProcedure procedure)
com.gs.collections.api.bag.primitive.CharBagforEachWithOccurrences in interface com.gs.collections.api.bag.primitive.CharBagpublic boolean add(char item)
add in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean remove(char item)
remove in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean addAll(char... source)
addAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean addAll(com.gs.collections.api.CharIterable source)
addAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean removeAll(char... source)
removeAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean removeAll(com.gs.collections.api.CharIterable source)
removeAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic boolean retainAll(com.gs.collections.api.CharIterable source)
retainAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionCollection.retainAll(Collection)public boolean retainAll(char... source)
retainAll in interface com.gs.collections.api.collection.primitive.MutableCharCollectionCollection.retainAll(Collection)public void addOccurrences(char item,
int occurrences)
addOccurrences in interface com.gs.collections.api.bag.primitive.MutableCharBagpublic boolean removeOccurrences(char item,
int occurrences)
removeOccurrences in interface com.gs.collections.api.bag.primitive.MutableCharBagpublic void forEach(com.gs.collections.api.block.procedure.primitive.CharProcedure procedure)
forEach in interface com.gs.collections.api.CharIterablepublic void each(com.gs.collections.api.block.procedure.primitive.CharProcedure procedure)
each in interface com.gs.collections.api.CharIterablepublic CharHashBag select(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
select in interface com.gs.collections.api.bag.primitive.CharBagselect in interface com.gs.collections.api.bag.primitive.MutableCharBagselect in interface com.gs.collections.api.CharIterableselect in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic CharHashBag reject(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
reject in interface com.gs.collections.api.bag.primitive.CharBagreject in interface com.gs.collections.api.bag.primitive.MutableCharBagreject in interface com.gs.collections.api.CharIterablereject in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic <T> T injectInto(T injectedValue,
com.gs.collections.api.block.function.primitive.ObjectCharToObjectFunction<? super T,? extends T> function)
injectInto in interface com.gs.collections.api.CharIterablepublic boolean equals(java.lang.Object otherBag)
com.gs.collections.api.bag.primitive.CharBagBag.equals(Object).equals in interface com.gs.collections.api.bag.primitive.CharBagequals in class java.lang.Objectpublic int hashCode()
com.gs.collections.api.bag.primitive.CharBagBag.hashCode().hashCode in interface com.gs.collections.api.bag.primitive.CharBaghashCode in class java.lang.Objectpublic void appendString(java.lang.Appendable appendable,
java.lang.String start,
java.lang.String separator,
java.lang.String end)
com.gs.collections.api.PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface com.gs.collections.api.PrimitiveIterablepublic int count(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
count in interface com.gs.collections.api.CharIterablepublic boolean anySatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
anySatisfy in interface com.gs.collections.api.CharIterablepublic boolean allSatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
allSatisfy in interface com.gs.collections.api.CharIterablepublic boolean noneSatisfy(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate)
noneSatisfy in interface com.gs.collections.api.CharIterablepublic char detectIfNone(com.gs.collections.api.block.predicate.primitive.CharPredicate predicate,
char ifNone)
detectIfNone in interface com.gs.collections.api.CharIterablepublic <V> com.gs.collections.api.bag.MutableBag<V> collect(com.gs.collections.api.block.function.primitive.CharToObjectFunction<? extends V> function)
collect in interface com.gs.collections.api.bag.primitive.CharBagcollect in interface com.gs.collections.api.bag.primitive.MutableCharBagcollect in interface com.gs.collections.api.CharIterablecollect in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic char max()
max in interface com.gs.collections.api.CharIterablepublic char min()
min in interface com.gs.collections.api.CharIterablepublic long sum()
sum in interface com.gs.collections.api.CharIterablepublic char[] toArray()
toArray in interface com.gs.collections.api.CharIterablepublic com.gs.collections.api.bag.primitive.MutableCharBag asUnmodifiable()
asUnmodifiable in interface com.gs.collections.api.bag.primitive.MutableCharBagasUnmodifiable in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic com.gs.collections.api.bag.primitive.MutableCharBag asSynchronized()
asSynchronized in interface com.gs.collections.api.bag.primitive.MutableCharBagasSynchronized in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic com.gs.collections.api.bag.primitive.ImmutableCharBag toImmutable()
com.gs.collections.api.bag.primitive.MutableCharBagtoImmutable in interface com.gs.collections.api.bag.primitive.CharBagtoImmutable in interface com.gs.collections.api.bag.primitive.MutableCharBagtoImmutable in interface com.gs.collections.api.collection.primitive.MutableCharCollectionpublic com.gs.collections.api.iterator.MutableCharIterator charIterator()
charIterator in interface com.gs.collections.api.CharIterablecharIterator in interface com.gs.collections.api.collection.primitive.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.IOException