Class AbstractMutableBooleanValuesMap
- java.lang.Object
-
- org.eclipse.collections.impl.primitive.AbstractBooleanIterable
-
- org.eclipse.collections.impl.map.mutable.primitive.AbstractMutableBooleanValuesMap
-
- All Implemented Interfaces:
BooleanIterable
,BooleanValuesMap
,MutableBooleanValuesMap
,PrimitiveIterable
- Direct Known Subclasses:
ByteBooleanHashMap
,CharBooleanHashMap
,DoubleBooleanHashMap
,FloatBooleanHashMap
,IntBooleanHashMap
,LongBooleanHashMap
,ShortBooleanHashMap
public abstract class AbstractMutableBooleanValuesMap extends AbstractBooleanIterable implements MutableBooleanValuesMap
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
AbstractMutableBooleanValuesMap.AbstractBooleanValuesCollection
protected static class
AbstractMutableBooleanValuesMap.SentinelValues
-
Constructor Summary
Constructors Constructor Description AbstractMutableBooleanValuesMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
addEmptyKeyValue(boolean value)
protected void
addRemovedKeyValue(boolean value)
boolean
allSatisfy(BooleanPredicate predicate)
Returns true if all of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.boolean
anySatisfy(BooleanPredicate predicate)
Returns true if any of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.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 givenAppendable
.RichIterable<BooleanIterable>
chunk(int size)
Partitions elements in fixed size chunks.<V> MutableBag<V>
collect(BooleanToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection.boolean
contains(boolean value)
Returns true if the value is contained in the BooleanIterable, and false if it is not.boolean
containsAll(BooleanIterable source)
Returns true if all of the values specified in the source BooleanIterable are contained in the BooleanIterable, and false if they are not.int
count(BooleanPredicate predicate)
Returns a count of the number of elements in the BooleanIterable that return true for the specified predicate.boolean
detectIfNone(BooleanPredicate predicate, boolean value)
void
each(BooleanProcedure procedure)
A synonym for forEach.void
forEach(BooleanProcedure procedure)
Applies the BooleanProcedure to each element in the BooleanIterable.void
forEachValue(BooleanProcedure procedure)
Iterates through each value in this map.protected abstract boolean
getEmptyValue()
protected abstract int
getOccupiedWithData()
protected abstract AbstractMutableBooleanValuesMap.SentinelValues
getSentinelValues()
protected abstract int
getTableSize()
protected abstract boolean
getValueAtIndex(int index)
<V> V
injectInto(V injectedValue, ObjectBooleanToObjectFunction<? super V,? extends V> function)
boolean
isEmpty()
Returns true if this iterable has zero items.protected abstract boolean
isNonSentinelAtIndex(int index)
boolean
noneSatisfy(BooleanPredicate predicate)
Returns true if none of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.boolean
notEmpty()
The English equivalent of !this.isEmpty()MutableBooleanBag
reject(BooleanPredicate predicate)
Returns a new BooleanIterable with all of the elements in the BooleanIterable that return false for the specified predicate.protected void
removeEmptyKey()
protected void
removeRemovedKey()
MutableBooleanBag
select(BooleanPredicate predicate)
Returns a new BooleanIterable with all of the elements in the BooleanIterable that return true for the specified predicate.protected abstract void
setSentinelValuesNull()
int
size()
Returns the number of items in this iterable.boolean[]
toArray()
Converts the BooleanIterable to a primitive boolean array.boolean[]
toArray(boolean[] array)
Converts the BooleanIterable to a primitive boolean array.-
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractBooleanIterable
asLazy, toBag, toList, toSet, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.BooleanIterable
asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, reduce, reduceIfEmpty, reject, select, toBag, toList, toSet
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.BooleanValuesMap
containsValue, tap, values
-
Methods inherited from interface org.eclipse.collections.api.map.primitive.MutableBooleanValuesMap
booleanIterator, clear
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, makeString, makeString, makeString, toString
-
-
-
-
Method Detail
-
getOccupiedWithData
protected abstract int getOccupiedWithData()
-
getSentinelValues
protected abstract AbstractMutableBooleanValuesMap.SentinelValues getSentinelValues()
-
setSentinelValuesNull
protected abstract void setSentinelValuesNull()
-
getEmptyValue
protected abstract boolean getEmptyValue()
-
getValueAtIndex
protected abstract boolean getValueAtIndex(int index)
-
getTableSize
protected abstract int getTableSize()
-
isNonSentinelAtIndex
protected abstract boolean isNonSentinelAtIndex(int index)
-
addEmptyKeyValue
protected void addEmptyKeyValue(boolean value)
-
removeEmptyKey
protected void removeEmptyKey()
-
addRemovedKeyValue
protected void addRemovedKeyValue(boolean value)
-
removeRemovedKey
protected void removeRemovedKey()
-
contains
public boolean contains(boolean value)
Description copied from interface:BooleanIterable
Returns true if the value is contained in the BooleanIterable, and false if it is not.- Specified by:
contains
in interfaceBooleanIterable
-
containsAll
public boolean containsAll(BooleanIterable source)
Description copied from interface:BooleanIterable
Returns true if all of the values specified in the source BooleanIterable are contained in the BooleanIterable, and false if they are not.- Specified by:
containsAll
in interfaceBooleanIterable
-
size
public int size()
Description copied from interface:PrimitiveIterable
Returns the number of items in this iterable.- Specified by:
size
in interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()
Description copied from interface:PrimitiveIterable
Returns true if this iterable has zero items.- Specified by:
isEmpty
in interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
Description copied from interface:PrimitiveIterable
The English equivalent of !this.isEmpty()- Specified by:
notEmpty
in interfacePrimitiveIterable
-
forEach
public void forEach(BooleanProcedure procedure)
Description copied from interface:BooleanIterable
Applies the BooleanProcedure to each element in the BooleanIterable.- Specified by:
forEach
in interfaceBooleanIterable
-
each
public void each(BooleanProcedure procedure)
Description copied from interface:BooleanIterable
A synonym for forEach.- Specified by:
each
in interfaceBooleanIterable
- Since:
- 7.0.
-
forEachValue
public void forEachValue(BooleanProcedure procedure)
Description copied from interface:BooleanValuesMap
Iterates through each value in this map.- Specified by:
forEachValue
in interfaceBooleanValuesMap
- Parameters:
procedure
- the procedure to invoke for each value in this map.
-
injectInto
public <V> V injectInto(V injectedValue, ObjectBooleanToObjectFunction<? super V,? extends V> function)
- Specified by:
injectInto
in interfaceBooleanIterable
-
chunk
public RichIterable<BooleanIterable> chunk(int size)
Description copied from interface:BooleanIterable
Partitions elements in fixed size chunks.- Specified by:
chunk
in interfaceBooleanIterable
- Parameters:
size
- the number of elements per chunk- Returns:
- A
RichIterable
containingBooleanIterable
s of sizesize
, except the last will be truncated if the elements don't divide evenly.
-
appendString
public void appendString(java.lang.Appendable appendable, java.lang.String start, java.lang.String separator, java.lang.String end)
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString(String, String, String)
.- Specified by:
appendString
in interfacePrimitiveIterable
-
select
public MutableBooleanBag select(BooleanPredicate predicate)
Description copied from interface:BooleanIterable
Returns a new BooleanIterable with all of the elements in the BooleanIterable that return true for the specified predicate.- Specified by:
select
in interfaceBooleanIterable
- Specified by:
select
in interfaceBooleanValuesMap
- Specified by:
select
in interfaceMutableBooleanValuesMap
-
reject
public MutableBooleanBag reject(BooleanPredicate predicate)
Description copied from interface:BooleanIterable
Returns a new BooleanIterable with all of the elements in the BooleanIterable that return false for the specified predicate.- Specified by:
reject
in interfaceBooleanIterable
- Specified by:
reject
in interfaceBooleanValuesMap
- Specified by:
reject
in interfaceMutableBooleanValuesMap
-
collect
public <V> MutableBag<V> collect(BooleanToObjectFunction<? extends V> function)
Description copied from interface:BooleanIterable
Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map.- Specified by:
collect
in interfaceBooleanIterable
- Specified by:
collect
in interfaceBooleanValuesMap
- Specified by:
collect
in interfaceMutableBooleanValuesMap
-
detectIfNone
public boolean detectIfNone(BooleanPredicate predicate, boolean value)
- Specified by:
detectIfNone
in interfaceBooleanIterable
-
count
public int count(BooleanPredicate predicate)
Description copied from interface:BooleanIterable
Returns a count of the number of elements in the BooleanIterable that return true for the specified predicate.- Specified by:
count
in interfaceBooleanIterable
-
anySatisfy
public boolean anySatisfy(BooleanPredicate predicate)
Description copied from interface:BooleanIterable
Returns true if any of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfy
in interfaceBooleanIterable
-
allSatisfy
public boolean allSatisfy(BooleanPredicate predicate)
Description copied from interface:BooleanIterable
Returns true if all of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfy
in interfaceBooleanIterable
-
noneSatisfy
public boolean noneSatisfy(BooleanPredicate predicate)
Description copied from interface:BooleanIterable
Returns true if none of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfy
in interfaceBooleanIterable
-
toArray
public boolean[] toArray()
Description copied from interface:BooleanIterable
Converts the BooleanIterable to a primitive boolean array.- Specified by:
toArray
in interfaceBooleanIterable
-
toArray
public boolean[] toArray(boolean[] array)
Description copied from interface:BooleanIterable
Converts the BooleanIterable to a primitive boolean array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.- Specified by:
toArray
in interfaceBooleanIterable
-
-