Class CharHashBag
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractCharIterable
-
- org.eclipse.collections.impl.bag.mutable.primitive.CharHashBag
-
- All Implemented Interfaces:
Externalizable,Serializable,CharBag,MutableCharBag,CharIterable,MutableCharCollection,PrimitiveIterable
public class CharHashBag extends AbstractCharIterable implements MutableCharBag, Externalizable
CharHashBag is similar toHashBag, and is memory-optimized for char primitives. This file was automatically generated from template file primitiveHashBag.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CharHashBag()CharHashBag(char... elements)CharHashBag(int size)CharHashBag(CharIterable iterable)CharHashBag(CharHashBag bag)
-
Method Summary
-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractCharIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.CharBag
toStringOfItemToCount
-
Methods inherited from interface org.eclipse.collections.api.CharIterable
asLazy, average, averageIfEmpty, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, reduce, reduceIfEmpty, reject, select, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableCharBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
-
-
-
Constructor Detail
-
CharHashBag
public CharHashBag()
-
CharHashBag
public CharHashBag(int size)
-
CharHashBag
public CharHashBag(CharIterable iterable)
-
CharHashBag
public CharHashBag(char... elements)
-
CharHashBag
public CharHashBag(CharHashBag bag)
-
-
Method Detail
-
newBag
public static CharHashBag newBag(int size)
-
newBagWith
public static CharHashBag newBagWith(char... source)
-
newBag
public static CharHashBag newBag(CharIterable source)
-
newBag
public static CharHashBag newBag(CharBag source)
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmptyin interfacePrimitiveIterable
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
sizeDistinct
public int sizeDistinct()
- Specified by:
sizeDistinctin interfaceCharBag
-
clear
public void clear()
- Specified by:
clearin interfaceMutableCharCollection
-
with
public CharHashBag with(char element)
- Specified by:
within interfaceMutableCharBag- Specified by:
within interfaceMutableCharCollection
-
with
public CharHashBag with(char element1, char element2)
-
with
public CharHashBag with(char element1, char element2, char element3)
-
withAll
public CharHashBag withAll(CharIterable iterable)
- Specified by:
withAllin interfaceMutableCharBag- Specified by:
withAllin interfaceMutableCharCollection
-
without
public CharHashBag without(char element)
- Specified by:
withoutin interfaceMutableCharBag- Specified by:
withoutin interfaceMutableCharCollection
-
withoutAll
public CharHashBag withoutAll(CharIterable iterable)
- Specified by:
withoutAllin interfaceMutableCharBag- Specified by:
withoutAllin interfaceMutableCharCollection
-
contains
public boolean contains(char value)
- Specified by:
containsin interfaceCharIterable
-
occurrencesOf
public int occurrencesOf(char item)
- Specified by:
occurrencesOfin interfaceCharBag
-
forEachWithOccurrences
public void forEachWithOccurrences(CharIntProcedure procedure)
- Specified by:
forEachWithOccurrencesin interfaceCharBag
-
selectByOccurrences
public CharHashBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrencesin interfaceCharBag- Specified by:
selectByOccurrencesin interfaceMutableCharBag
-
selectUnique
public MutableCharSet selectUnique()
- Specified by:
selectUniquein interfaceCharBag- Specified by:
selectUniquein interfaceMutableCharBag
-
topOccurrences
public MutableList<CharIntPair> topOccurrences(int count)
- Specified by:
topOccurrencesin interfaceCharBag- Specified by:
topOccurrencesin interfaceMutableCharBag
-
bottomOccurrences
public MutableList<CharIntPair> bottomOccurrences(int count)
- Specified by:
bottomOccurrencesin interfaceCharBag- Specified by:
bottomOccurrencesin interfaceMutableCharBag
-
add
public boolean add(char item)
- Specified by:
addin interfaceMutableCharCollection
-
remove
public boolean remove(char item)
- Specified by:
removein interfaceMutableCharCollection
-
removeIf
public boolean removeIf(CharPredicate predicate)
- Specified by:
removeIfin interfaceMutableCharCollection
-
addAll
public boolean addAll(char... source)
- Specified by:
addAllin interfaceMutableCharCollection
-
addAll
public boolean addAll(CharIterable source)
- Specified by:
addAllin interfaceMutableCharCollection
-
removeAll
public boolean removeAll(char... source)
- Specified by:
removeAllin interfaceMutableCharCollection
-
removeAll
public boolean removeAll(CharIterable source)
- Specified by:
removeAllin interfaceMutableCharCollection
-
retainAll
public boolean retainAll(CharIterable source)
- Specified by:
retainAllin interfaceMutableCharCollection
-
retainAll
public boolean retainAll(char... source)
- Specified by:
retainAllin interfaceMutableCharCollection
-
addOccurrences
public void addOccurrences(char item, int occurrences)- Specified by:
addOccurrencesin interfaceMutableCharBag
-
removeOccurrences
public boolean removeOccurrences(char item, int occurrences)- Specified by:
removeOccurrencesin interfaceMutableCharBag
-
each
public void each(CharProcedure procedure)
- Specified by:
eachin interfaceCharIterable- Since:
- 7.0.
-
select
public CharHashBag select(CharPredicate predicate)
- Specified by:
selectin interfaceCharBag- Specified by:
selectin interfaceCharIterable- Specified by:
selectin interfaceMutableCharBag- Specified by:
selectin interfaceMutableCharCollection
-
reject
public CharHashBag reject(CharPredicate predicate)
- Specified by:
rejectin interfaceCharBag- Specified by:
rejectin interfaceCharIterable- Specified by:
rejectin interfaceMutableCharBag- Specified by:
rejectin interfaceMutableCharCollection
-
injectInto
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceCharIterable
-
chunk
public RichIterable<CharIterable> chunk(int size)
- Specified by:
chunkin interfaceCharIterable
-
equals
public boolean equals(Object otherBag)
-
hashCode
public int hashCode()
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
count
public int count(CharPredicate predicate)
- Specified by:
countin interfaceCharIterable
-
anySatisfy
public boolean anySatisfy(CharPredicate predicate)
- Specified by:
anySatisfyin interfaceCharIterable
-
allSatisfy
public boolean allSatisfy(CharPredicate predicate)
- Specified by:
allSatisfyin interfaceCharIterable
-
noneSatisfy
public boolean noneSatisfy(CharPredicate predicate)
- Specified by:
noneSatisfyin interfaceCharIterable
-
detectIfNone
public char detectIfNone(CharPredicate predicate, char ifNone)
- Specified by:
detectIfNonein interfaceCharIterable
-
collect
public <V> MutableBag<V> collect(CharToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceCharBag- Specified by:
collectin interfaceCharIterable- Specified by:
collectin interfaceMutableCharBag- Specified by:
collectin interfaceMutableCharCollection
-
max
public char max()
- Specified by:
maxin interfaceCharIterable
-
min
public char min()
- Specified by:
minin interfaceCharIterable
-
sum
public long sum()
- Specified by:
sumin interfaceCharIterable
-
toArray
public char[] toArray()
- Specified by:
toArrayin interfaceCharIterable
-
toArray
public char[] toArray(char[] array)
- Specified by:
toArrayin interfaceCharIterable
-
asUnmodifiable
public MutableCharBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableCharBag- Specified by:
asUnmodifiablein interfaceMutableCharCollection
-
asSynchronized
public MutableCharBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableCharBag- Specified by:
asSynchronizedin interfaceMutableCharCollection
-
toImmutable
public ImmutableCharBag toImmutable()
- Specified by:
toImmutablein interfaceCharBag- Specified by:
toImmutablein interfaceMutableCharBag- Specified by:
toImmutablein interfaceMutableCharCollection
-
newEmpty
public CharHashBag newEmpty()
Creates a new empty CharHashBag.- Specified by:
newEmptyin interfaceMutableCharBag- Specified by:
newEmptyin interfaceMutableCharCollection- Since:
- 9.2.
-
charIterator
public MutableCharIterator charIterator()
- Specified by:
charIteratorin interfaceCharIterable- Specified by:
charIteratorin interfaceMutableCharCollection
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
-