@NotThreadSafe public final class CharHashBag extends AbstractCharIterable 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(char... elements) |
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,
String start,
String separator,
String end)
Prints a string representation of this collection onto the given
Appendable . |
MutableCharBag |
asSynchronized() |
MutableCharBag |
asUnmodifiable() |
MutableCharIterator |
charIterator() |
void |
clear() |
<V> MutableBag<V> |
collect(CharToObjectFunction<? extends V> function) |
boolean |
contains(char value) |
int |
count(CharPredicate predicate) |
char |
detectIfNone(CharPredicate predicate,
char ifNone) |
void |
each(CharProcedure procedure) |
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.
|
char |
max() |
char |
min() |
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() |
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(CharIterable iterable) |
CharHashBag |
without(char element) |
CharHashBag |
withoutAll(CharIterable iterable) |
void |
writeExternal(ObjectOutput out) |
appendString, appendString, asLazy, average, containsAll, containsAll, makeString, makeString, makeString, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
asLazy, average, containsAll, containsAll, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList
appendString, appendString, makeString, makeString, makeString, toString
public 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()
PrimitiveIterable
isEmpty
in interface PrimitiveIterable
isEmpty
in class AbstractCharIterable
public boolean notEmpty()
PrimitiveIterable
notEmpty
in interface PrimitiveIterable
notEmpty
in class AbstractCharIterable
public int size()
PrimitiveIterable
size
in interface PrimitiveIterable
public int sizeDistinct()
CharBag
sizeDistinct
in interface CharBag
public void clear()
clear
in interface MutableCharCollection
public CharHashBag with(char element)
with
in interface MutableCharBag
with
in interface MutableCharCollection
public CharHashBag with(char element1, char element2)
public CharHashBag with(char element1, char element2, char element3)
public CharHashBag withAll(CharIterable iterable)
withAll
in interface MutableCharBag
withAll
in interface MutableCharCollection
public CharHashBag without(char element)
without
in interface MutableCharBag
without
in interface MutableCharCollection
public CharHashBag withoutAll(CharIterable iterable)
withoutAll
in interface MutableCharBag
withoutAll
in interface MutableCharCollection
public boolean contains(char value)
contains
in interface CharIterable
public int occurrencesOf(char item)
CharBag
occurrencesOf
in interface CharBag
public void forEachWithOccurrences(CharIntProcedure procedure)
CharBag
forEachWithOccurrences
in interface CharBag
public boolean add(char item)
add
in interface MutableCharCollection
public boolean remove(char item)
remove
in interface MutableCharCollection
public boolean addAll(char... source)
addAll
in interface MutableCharCollection
public boolean addAll(CharIterable source)
addAll
in interface MutableCharCollection
public boolean removeAll(char... source)
removeAll
in interface MutableCharCollection
public boolean removeAll(CharIterable source)
removeAll
in interface MutableCharCollection
public boolean retainAll(CharIterable source)
retainAll
in interface MutableCharCollection
Collection.retainAll(Collection)
public boolean retainAll(char... source)
retainAll
in interface MutableCharCollection
Collection.retainAll(Collection)
public void addOccurrences(char item, int occurrences)
addOccurrences
in interface MutableCharBag
public boolean removeOccurrences(char item, int occurrences)
removeOccurrences
in interface MutableCharBag
public void forEach(CharProcedure procedure)
forEach
in interface CharIterable
public void each(CharProcedure procedure)
each
in interface CharIterable
public CharHashBag select(CharPredicate predicate)
select
in interface CharBag
select
in interface MutableCharBag
select
in interface CharIterable
select
in interface MutableCharCollection
public CharHashBag reject(CharPredicate predicate)
reject
in interface CharBag
reject
in interface MutableCharBag
reject
in interface CharIterable
reject
in interface MutableCharCollection
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)
injectInto
in interface CharIterable
public boolean equals(Object otherBag)
CharBag
Bag.equals(Object)
.public int hashCode()
CharBag
Bag.hashCode()
.public void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterable
Appendable
. Prints the string returned
by PrimitiveIterable.makeString(String, String, String)
.appendString
in interface PrimitiveIterable
public int count(CharPredicate predicate)
count
in interface CharIterable
public boolean anySatisfy(CharPredicate predicate)
anySatisfy
in interface CharIterable
public boolean allSatisfy(CharPredicate predicate)
allSatisfy
in interface CharIterable
public boolean noneSatisfy(CharPredicate predicate)
noneSatisfy
in interface CharIterable
public char detectIfNone(CharPredicate predicate, char ifNone)
detectIfNone
in interface CharIterable
public <V> MutableBag<V> collect(CharToObjectFunction<? extends V> function)
collect
in interface CharBag
collect
in interface MutableCharBag
collect
in interface CharIterable
collect
in interface MutableCharCollection
public char max()
max
in interface CharIterable
public char min()
min
in interface CharIterable
public long sum()
sum
in interface CharIterable
public char[] toArray()
toArray
in interface CharIterable
public MutableCharBag asUnmodifiable()
asUnmodifiable
in interface MutableCharBag
asUnmodifiable
in interface MutableCharCollection
public MutableCharBag asSynchronized()
asSynchronized
in interface MutableCharBag
asSynchronized
in interface MutableCharCollection
public ImmutableCharBag toImmutable()
MutableCharBag
toImmutable
in interface CharBag
toImmutable
in interface MutableCharBag
toImmutable
in interface MutableCharCollection
public MutableCharIterator charIterator()
charIterator
in interface CharIterable
charIterator
in interface MutableCharCollection
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
Copyright © 2004–2016. All rights reserved.