Class BooleanHashBag
- java.lang.Object
-
- org.eclipse.collections.impl.bag.mutable.primitive.BooleanHashBag
-
- All Implemented Interfaces:
Externalizable,Serializable,BooleanBag,MutableBooleanBag,BooleanIterable,MutableBooleanCollection,PrimitiveIterable
public final class BooleanHashBag extends Object implements MutableBooleanBag, Externalizable
BooleanHashBag is similar toHashBag, and is memory-optimized for boolean primitives.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BooleanHashBag()BooleanHashBag(boolean... elements)BooleanHashBag(BooleanIterable iterable)BooleanHashBag(BooleanHashBag bag)
-
Method Summary
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.BooleanBag
toStringOfItemToCount
-
Methods inherited from interface org.eclipse.collections.api.BooleanIterable
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, reduce, reduceIfEmpty, reject, select
-
Methods inherited from interface org.eclipse.collections.api.bag.primitive.MutableBooleanBag
newEmpty, selectDuplicates, tap
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableBooleanCollection
removeIf
-
-
-
-
Constructor Detail
-
BooleanHashBag
public BooleanHashBag()
-
BooleanHashBag
public BooleanHashBag(BooleanIterable iterable)
-
BooleanHashBag
public BooleanHashBag(boolean... elements)
-
BooleanHashBag
public BooleanHashBag(BooleanHashBag bag)
-
-
Method Detail
-
newBagWith
public static BooleanHashBag newBagWith(boolean... source)
-
newBag
public static BooleanHashBag newBag(BooleanIterable 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 interfaceBooleanBag
-
clear
public void clear()
- Specified by:
clearin interfaceMutableBooleanCollection
-
with
public BooleanHashBag with(boolean element)
- Specified by:
within interfaceMutableBooleanBag- Specified by:
within interfaceMutableBooleanCollection
-
with
public BooleanHashBag with(boolean element1, boolean element2)
-
with
public BooleanHashBag with(boolean element1, boolean element2, boolean element3)
-
withAll
public BooleanHashBag withAll(BooleanIterable iterable)
- Specified by:
withAllin interfaceMutableBooleanBag- Specified by:
withAllin interfaceMutableBooleanCollection
-
without
public BooleanHashBag without(boolean element)
- Specified by:
withoutin interfaceMutableBooleanBag- Specified by:
withoutin interfaceMutableBooleanCollection
-
withoutAll
public BooleanHashBag withoutAll(BooleanIterable iterable)
- Specified by:
withoutAllin interfaceMutableBooleanBag- Specified by:
withoutAllin interfaceMutableBooleanCollection
-
asUnmodifiable
public MutableBooleanBag asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableBooleanBag- Specified by:
asUnmodifiablein interfaceMutableBooleanCollection
-
asSynchronized
public MutableBooleanBag asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableBooleanBag- Specified by:
asSynchronizedin interfaceMutableBooleanCollection
-
toImmutable
public ImmutableBooleanBag toImmutable()
- Specified by:
toImmutablein interfaceBooleanBag- Specified by:
toImmutablein interfaceMutableBooleanBag- Specified by:
toImmutablein interfaceMutableBooleanCollection
-
contains
public boolean contains(boolean value)
- Specified by:
containsin interfaceBooleanIterable
-
containsAll
public boolean containsAll(boolean... source)
- Specified by:
containsAllin interfaceBooleanIterable
-
containsAll
public boolean containsAll(BooleanIterable source)
- Specified by:
containsAllin interfaceBooleanIterable
-
occurrencesOf
public int occurrencesOf(boolean item)
- Specified by:
occurrencesOfin interfaceBooleanBag
-
forEachWithOccurrences
public void forEachWithOccurrences(BooleanIntProcedure procedure)
- Specified by:
forEachWithOccurrencesin interfaceBooleanBag
-
add
public boolean add(boolean item)
- Specified by:
addin interfaceMutableBooleanCollection
-
remove
public boolean remove(boolean item)
- Specified by:
removein interfaceMutableBooleanCollection
-
addAll
public boolean addAll(boolean... source)
- Specified by:
addAllin interfaceMutableBooleanCollection
-
addAll
public boolean addAll(BooleanIterable source)
- Specified by:
addAllin interfaceMutableBooleanCollection
-
removeAll
public boolean removeAll(boolean... source)
- Specified by:
removeAllin interfaceMutableBooleanCollection
-
removeAll
public boolean removeAll(BooleanIterable source)
- Specified by:
removeAllin interfaceMutableBooleanCollection
-
retainAll
public boolean retainAll(BooleanIterable elements)
- Specified by:
retainAllin interfaceMutableBooleanCollection
-
retainAll
public boolean retainAll(boolean... source)
- Specified by:
retainAllin interfaceMutableBooleanCollection
-
addOccurrences
public void addOccurrences(boolean item, int occurrences)- Specified by:
addOccurrencesin interfaceMutableBooleanBag
-
removeOccurrences
public boolean removeOccurrences(boolean item, int occurrences)- Specified by:
removeOccurrencesin interfaceMutableBooleanBag
-
each
public void each(BooleanProcedure procedure)
- Specified by:
eachin interfaceBooleanIterable- Since:
- 7.0.
-
select
public MutableBooleanBag select(BooleanPredicate predicate)
- Specified by:
selectin interfaceBooleanBag- Specified by:
selectin interfaceBooleanIterable- Specified by:
selectin interfaceMutableBooleanBag- Specified by:
selectin interfaceMutableBooleanCollection
-
selectByOccurrences
public MutableBooleanBag selectByOccurrences(IntPredicate predicate)
- Specified by:
selectByOccurrencesin interfaceBooleanBag- Specified by:
selectByOccurrencesin interfaceMutableBooleanBag
-
topOccurrences
public MutableList<BooleanIntPair> topOccurrences(int count)
- Specified by:
topOccurrencesin interfaceBooleanBag- Specified by:
topOccurrencesin interfaceMutableBooleanBag
-
bottomOccurrences
public MutableList<BooleanIntPair> bottomOccurrences(int count)
- Specified by:
bottomOccurrencesin interfaceBooleanBag- Specified by:
bottomOccurrencesin interfaceMutableBooleanBag
-
reject
public MutableBooleanBag reject(BooleanPredicate predicate)
- Specified by:
rejectin interfaceBooleanBag- Specified by:
rejectin interfaceBooleanIterable- Specified by:
rejectin interfaceMutableBooleanBag- Specified by:
rejectin interfaceMutableBooleanCollection
-
injectInto
public <T> T injectInto(T injectedValue, ObjectBooleanToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceBooleanIterable
-
chunk
public RichIterable<BooleanIterable> chunk(int size)
- Specified by:
chunkin interfaceBooleanIterable
-
equals
public boolean equals(Object otherBag)
- Specified by:
equalsin interfaceBooleanBag- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceBooleanBag- Overrides:
hashCodein classObject
-
toString
public String toString()
- Specified by:
toStringin interfacePrimitiveIterable- Overrides:
toStringin classObject
-
makeString
public String makeString()
- Specified by:
makeStringin interfacePrimitiveIterable
-
makeString
public String makeString(String separator)
- Specified by:
makeStringin interfacePrimitiveIterable
-
makeString
public String makeString(String start, String separator, String end)
- Specified by:
makeStringin interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable)
- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String separator)
- Specified by:
appendStringin interfacePrimitiveIterable
-
appendString
public void appendString(Appendable appendable, String start, String separator, String end)
- Specified by:
appendStringin interfacePrimitiveIterable
-
count
public int count(BooleanPredicate predicate)
- Specified by:
countin interfaceBooleanIterable
-
anySatisfy
public boolean anySatisfy(BooleanPredicate predicate)
- Specified by:
anySatisfyin interfaceBooleanIterable
-
allSatisfy
public boolean allSatisfy(BooleanPredicate predicate)
- Specified by:
allSatisfyin interfaceBooleanIterable
-
noneSatisfy
public boolean noneSatisfy(BooleanPredicate predicate)
- Specified by:
noneSatisfyin interfaceBooleanIterable
-
detectIfNone
public boolean detectIfNone(BooleanPredicate predicate, boolean ifNone)
- Specified by:
detectIfNonein interfaceBooleanIterable
-
collect
public <V> MutableBag<V> collect(BooleanToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceBooleanBag- Specified by:
collectin interfaceBooleanIterable- Specified by:
collectin interfaceMutableBooleanBag- Specified by:
collectin interfaceMutableBooleanCollection
-
toArray
public boolean[] toArray()
- Specified by:
toArrayin interfaceBooleanIterable
-
toArray
public boolean[] toArray(boolean[] array)
- Specified by:
toArrayin interfaceBooleanIterable
-
toList
public MutableBooleanList toList()
- Specified by:
toListin interfaceBooleanIterable
-
toSet
public MutableBooleanSet toSet()
- Specified by:
toSetin interfaceBooleanIterable
-
toBag
public MutableBooleanBag toBag()
- Specified by:
toBagin interfaceBooleanIterable
-
asLazy
public LazyBooleanIterable asLazy()
- Specified by:
asLazyin interfaceBooleanIterable
-
booleanIterator
public MutableBooleanIterator booleanIterator()
- Specified by:
booleanIteratorin interfaceBooleanIterable- Specified by:
booleanIteratorin interfaceMutableBooleanCollection
-
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
-
selectUnique
public MutableBooleanSet selectUnique()
- Specified by:
selectUniquein interfaceBooleanBag- Specified by:
selectUniquein interfaceMutableBooleanBag
-
-