Class IntHashBag
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractIntIterable
-
- org.eclipse.collections.impl.bag.mutable.primitive.IntHashBag
-
- All Implemented Interfaces:
Externalizable,Serializable,IntBag,MutableIntBag,MutableIntCollection,IntIterable,PrimitiveIterable
public class IntHashBag extends AbstractIntIterable implements MutableIntBag, Externalizable
IntHashBag is similar toHashBag, and is memory-optimized for int primitives. This file was automatically generated from template file primitiveHashBag.stg.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description IntHashBag()IntHashBag(int size)IntHashBag(int... elements)IntHashBag(IntIterable iterable)IntHashBag(IntHashBag bag)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(int item)booleanaddAll(int... source)booleanaddAll(IntIterable source)voidaddOccurrences(int item, int occurrences)booleanallSatisfy(IntPredicate predicate)booleananySatisfy(IntPredicate predicate)voidappendString(Appendable appendable, String start, String separator, String end)MutableIntBagasSynchronized()MutableIntBagasUnmodifiable()MutableList<IntIntPair>bottomOccurrences(int count)RichIterable<IntIterable>chunk(int size)voidclear()<V> MutableBag<V>collect(IntToObjectFunction<? extends V> function)booleancontains(int value)intcount(IntPredicate predicate)intdetectIfNone(IntPredicate predicate, int ifNone)voideach(IntProcedure procedure)booleanequals(Object otherBag)voidforEachWithOccurrences(IntIntProcedure procedure)inthashCode()<T> TinjectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)MutableIntIteratorintIterator()booleanisEmpty()intmax()intmin()static IntHashBagnewBag(int size)static IntHashBagnewBag(IntBag source)static IntHashBagnewBag(IntIterable source)static IntHashBagnewBagWith(int... source)IntHashBagnewEmpty()Creates a new empty IntHashBag.booleannoneSatisfy(IntPredicate predicate)booleannotEmpty()intoccurrencesOf(int item)voidreadExternal(ObjectInput in)IntHashBagreject(IntPredicate predicate)booleanremove(int item)booleanremoveAll(int... source)booleanremoveAll(IntIterable source)booleanremoveIf(IntPredicate predicate)booleanremoveOccurrences(int item, int occurrences)booleanretainAll(int... source)booleanretainAll(IntIterable source)IntHashBagselect(IntPredicate predicate)IntHashBagselectByOccurrences(IntPredicate predicate)MutableIntSetselectUnique()intsize()intsizeDistinct()longsum()int[]toArray()int[]toArray(int[] array)ImmutableIntBagtoImmutable()MutableList<IntIntPair>topOccurrences(int count)IntHashBagwith(int element)IntHashBagwith(int element1, int element2)IntHashBagwith(int element1, int element2, int element3)IntHashBagwithAll(IntIterable iterable)IntHashBagwithout(int element)IntHashBagwithoutAll(IntIterable iterable)voidwriteExternal(ObjectOutput out)-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractIntIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.IntBag
toStringOfItemToCount
-
Methods inherited from interface org.eclipse.collections.api.IntIterable
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.MutableIntBag
selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
-
-
-
Constructor Detail
-
IntHashBag
public IntHashBag()
-
IntHashBag
public IntHashBag(int size)
-
IntHashBag
public IntHashBag(IntIterable iterable)
-
IntHashBag
public IntHashBag(int... elements)
-
IntHashBag
public IntHashBag(IntHashBag bag)
-
-
Method Detail
-
newBag
public static IntHashBag newBag(int size)
-
newBagWith
public static IntHashBag newBagWith(int... source)
-
newBag
public static IntHashBag newBag(IntIterable source)
-
newBag
public static IntHashBag newBag(IntBag 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 interfaceIntBag
-
clear
public void clear()
- Specified by:
clearin interfaceMutableIntCollection
-
with
public IntHashBag with(int element)
- Specified by:
within interfaceMutableIntBag- Specified by:
within interfaceMutableIntCollection
-
with
public IntHashBag with(int element1, int element2)
-
with
public IntHashBag with(int element1, int element2, int element3)
-
withAll
public IntHashBag withAll(IntIterable iterable)
- Specified by:
withAllin interfaceMutableIntBag- Specified by:
withAllin interfaceMutableIntCollection
-
without
public IntHashBag without(int element)
- Specified by:
withoutin interfaceMutableIntBag- Specified by:
withoutin interfaceMutableIntCollection
-
withoutAll
public IntHashBag withoutAll(IntIterable iterable)
- Specified by:
withoutAllin interfaceMutableIntBag- Specified by:
withoutAllin interfaceMutableIntCollection
-
contains
public boolean contains(int value)
- Specified by:
containsin interfaceIntIterable
-
occurrencesOf
public int occurrencesOf(int item)
- Specified by:
occurrencesOfin interfaceIntBag
-
forEachWithOccurrences
public void forEachWithOccurrences(IntIntProcedure procedure)
- Specified by:
forEachWithOccurrencesin interfaceIntBag
-
selectByOccurrences
public IntHashBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrencesin interfaceIntBag- Specified by:
selectByOccurrencesin interfaceMutableIntBag
-
selectUnique
public MutableIntSet selectUnique()
- Specified by:
selectUniquein interfaceIntBag- Specified by:
selectUniquein interfaceMutableIntBag
-
topOccurrences
public MutableList<IntIntPair> topOccurrences(int count)
- Specified by:
topOccurrencesin interfaceIntBag- Specified by:
topOccurrencesin interfaceMutableIntBag
-
bottomOccurrences
public MutableList<IntIntPair> bottomOccurrences(int count)
- Specified by:
bottomOccurrencesin interfaceIntBag- Specified by:
bottomOccurrencesin interfaceMutableIntBag
-
add
public boolean add(int item)
- Specified by:
addin interfaceMutableIntCollection
-
remove
public boolean remove(int item)
- Specified by:
removein interfaceMutableIntCollection
-
removeIf
public boolean removeIf(IntPredicate predicate)
- Specified by:
removeIfin interfaceMutableIntCollection
-
addAll
public boolean addAll(int... source)
- Specified by:
addAllin interfaceMutableIntCollection
-
addAll
public boolean addAll(IntIterable source)
- Specified by:
addAllin interfaceMutableIntCollection
-
removeAll
public boolean removeAll(int... source)
- Specified by:
removeAllin interfaceMutableIntCollection
-
removeAll
public boolean removeAll(IntIterable source)
- Specified by:
removeAllin interfaceMutableIntCollection
-
retainAll
public boolean retainAll(IntIterable source)
- Specified by:
retainAllin interfaceMutableIntCollection
-
retainAll
public boolean retainAll(int... source)
- Specified by:
retainAllin interfaceMutableIntCollection
-
addOccurrences
public void addOccurrences(int item, int occurrences)- Specified by:
addOccurrencesin interfaceMutableIntBag
-
removeOccurrences
public boolean removeOccurrences(int item, int occurrences)- Specified by:
removeOccurrencesin interfaceMutableIntBag
-
each
public void each(IntProcedure procedure)
- Specified by:
eachin interfaceIntIterable- Since:
- 7.0.
-
select
public IntHashBag select(IntPredicate predicate)
- Specified by:
selectin interfaceIntBag- Specified by:
selectin interfaceIntIterable- Specified by:
selectin interfaceMutableIntBag- Specified by:
selectin interfaceMutableIntCollection
-
reject
public IntHashBag reject(IntPredicate predicate)
- Specified by:
rejectin interfaceIntBag- Specified by:
rejectin interfaceIntIterable- Specified by:
rejectin interfaceMutableIntBag- Specified by:
rejectin interfaceMutableIntCollection
-
injectInto
public <T> T injectInto(T injectedValue, ObjectIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceIntIterable
-
chunk
public RichIterable<IntIterable> chunk(int size)
- Specified by:
chunkin interfaceIntIterable
-
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(IntPredicate predicate)
- Specified by:
countin interfaceIntIterable
-
anySatisfy
public boolean anySatisfy(IntPredicate predicate)
- Specified by:
anySatisfyin interfaceIntIterable
-
allSatisfy
public boolean allSatisfy(IntPredicate predicate)
- Specified by:
allSatisfyin interfaceIntIterable
-
noneSatisfy
public boolean noneSatisfy(IntPredicate predicate)
- Specified by:
noneSatisfyin interfaceIntIterable
-
detectIfNone
public int detectIfNone(IntPredicate predicate, int ifNone)
- Specified by:
detectIfNonein interfaceIntIterable
-
collect
public <V> MutableBag<V> collect(IntToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceIntBag- Specified by:
collectin interfaceIntIterable- Specified by:
collectin interfaceMutableIntBag- Specified by:
collectin interfaceMutableIntCollection
-
max
public int max()
- Specified by:
maxin interfaceIntIterable
-
min
public int min()
- Specified by:
minin interfaceIntIterable
-
sum
public long sum()
- Specified by:
sumin interfaceIntIterable
-
toArray
public int[] toArray()
- Specified by:
toArrayin interfaceIntIterable
-
toArray
public int[] toArray(int[] array)
- Specified by:
toArrayin interfaceIntIterable
-
asUnmodifiable
public MutableIntBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableIntBag- Specified by:
asUnmodifiablein interfaceMutableIntCollection
-
asSynchronized
public MutableIntBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableIntBag- Specified by:
asSynchronizedin interfaceMutableIntCollection
-
toImmutable
public ImmutableIntBag toImmutable()
- Specified by:
toImmutablein interfaceIntBag- Specified by:
toImmutablein interfaceMutableIntBag- Specified by:
toImmutablein interfaceMutableIntCollection
-
newEmpty
public IntHashBag newEmpty()
Creates a new empty IntHashBag.- Specified by:
newEmptyin interfaceMutableIntBag- Specified by:
newEmptyin interfaceMutableIntCollection- Since:
- 9.2.
-
intIterator
public MutableIntIterator intIterator()
- Specified by:
intIteratorin interfaceIntIterable- Specified by:
intIteratorin interfaceMutableIntCollection
-
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
-
-