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 classAbstractMutableBooleanValuesMap.AbstractBooleanValuesCollectionprotected static classAbstractMutableBooleanValuesMap.SentinelValues
-
Constructor Summary
Constructors Constructor Description AbstractMutableBooleanValuesMap()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidaddEmptyKeyValue(boolean value)protected voidaddRemovedKeyValue(boolean value)booleanallSatisfy(BooleanPredicate predicate)Returns true if all of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.booleananySatisfy(BooleanPredicate predicate)Returns true if any of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.voidappendString(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.booleancontains(boolean value)Returns true if the value is contained in the BooleanIterable, and false if it is not.booleancontainsAll(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.intcount(BooleanPredicate predicate)Returns a count of the number of elements in the BooleanIterable that return true for the specified predicate.booleandetectIfNone(BooleanPredicate predicate, boolean value)voideach(BooleanProcedure procedure)A synonym for forEach.voidforEach(BooleanProcedure procedure)Applies the BooleanProcedure to each element in the BooleanIterable.voidforEachValue(BooleanProcedure procedure)Iterates through each value in this map.protected abstract booleangetEmptyValue()protected abstract intgetOccupiedWithData()protected abstract AbstractMutableBooleanValuesMap.SentinelValuesgetSentinelValues()protected abstract intgetTableSize()protected abstract booleangetValueAtIndex(int index)<V> VinjectInto(V injectedValue, ObjectBooleanToObjectFunction<? super V,? extends V> function)booleanisEmpty()Returns true if this iterable has zero items.protected abstract booleanisNonSentinelAtIndex(int index)booleannoneSatisfy(BooleanPredicate predicate)Returns true if none of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.booleannotEmpty()The English equivalent of !this.isEmpty()MutableBooleanBagreject(BooleanPredicate predicate)Returns a new BooleanIterable with all of the elements in the BooleanIterable that return false for the specified predicate.protected voidremoveEmptyKey()protected voidremoveRemovedKey()MutableBooleanBagselect(BooleanPredicate predicate)Returns a new BooleanIterable with all of the elements in the BooleanIterable that return true for the specified predicate.protected abstract voidsetSentinelValuesNull()intsize()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:BooleanIterableReturns true if the value is contained in the BooleanIterable, and false if it is not.- Specified by:
containsin interfaceBooleanIterable
-
containsAll
public boolean containsAll(BooleanIterable source)
Description copied from interface:BooleanIterableReturns true if all of the values specified in the source BooleanIterable are contained in the BooleanIterable, and false if they are not.- Specified by:
containsAllin interfaceBooleanIterable
-
size
public int size()
Description copied from interface:PrimitiveIterableReturns the number of items in this iterable.- Specified by:
sizein interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()
Description copied from interface:PrimitiveIterableReturns true if this iterable has zero items.- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
Description copied from interface:PrimitiveIterableThe English equivalent of !this.isEmpty()- Specified by:
notEmptyin interfacePrimitiveIterable
-
forEach
public void forEach(BooleanProcedure procedure)
Description copied from interface:BooleanIterableApplies the BooleanProcedure to each element in the BooleanIterable.- Specified by:
forEachin interfaceBooleanIterable
-
each
public void each(BooleanProcedure procedure)
Description copied from interface:BooleanIterableA synonym for forEach.- Specified by:
eachin interfaceBooleanIterable- Since:
- 7.0.
-
forEachValue
public void forEachValue(BooleanProcedure procedure)
Description copied from interface:BooleanValuesMapIterates through each value in this map.- Specified by:
forEachValuein 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:
injectIntoin interfaceBooleanIterable
-
chunk
public RichIterable<BooleanIterable> chunk(int size)
Description copied from interface:BooleanIterablePartitions elements in fixed size chunks.- Specified by:
chunkin interfaceBooleanIterable- Parameters:
size- the number of elements per chunk- Returns:
- A
RichIterablecontainingBooleanIterables 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:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString(String, String, String).- Specified by:
appendStringin interfacePrimitiveIterable
-
select
public MutableBooleanBag select(BooleanPredicate predicate)
Description copied from interface:BooleanIterableReturns a new BooleanIterable with all of the elements in the BooleanIterable that return true for the specified predicate.- Specified by:
selectin interfaceBooleanIterable- Specified by:
selectin interfaceBooleanValuesMap- Specified by:
selectin interfaceMutableBooleanValuesMap
-
reject
public MutableBooleanBag reject(BooleanPredicate predicate)
Description copied from interface:BooleanIterableReturns a new BooleanIterable with all of the elements in the BooleanIterable that return false for the specified predicate.- Specified by:
rejectin interfaceBooleanIterable- Specified by:
rejectin interfaceBooleanValuesMap- Specified by:
rejectin interfaceMutableBooleanValuesMap
-
collect
public <V> MutableBag<V> collect(BooleanToObjectFunction<? extends V> function)
Description copied from interface:BooleanIterableReturns 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:
collectin interfaceBooleanIterable- Specified by:
collectin interfaceBooleanValuesMap- Specified by:
collectin interfaceMutableBooleanValuesMap
-
detectIfNone
public boolean detectIfNone(BooleanPredicate predicate, boolean value)
- Specified by:
detectIfNonein interfaceBooleanIterable
-
count
public int count(BooleanPredicate predicate)
Description copied from interface:BooleanIterableReturns a count of the number of elements in the BooleanIterable that return true for the specified predicate.- Specified by:
countin interfaceBooleanIterable
-
anySatisfy
public boolean anySatisfy(BooleanPredicate predicate)
Description copied from interface:BooleanIterableReturns true if any of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfyin interfaceBooleanIterable
-
allSatisfy
public boolean allSatisfy(BooleanPredicate predicate)
Description copied from interface:BooleanIterableReturns true if all of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfyin interfaceBooleanIterable
-
noneSatisfy
public boolean noneSatisfy(BooleanPredicate predicate)
Description copied from interface:BooleanIterableReturns true if none of the elements in the BooleanIterable return true for the specified predicate, otherwise returns false.- Specified by:
noneSatisfyin interfaceBooleanIterable
-
toArray
public boolean[] toArray()
Description copied from interface:BooleanIterableConverts the BooleanIterable to a primitive boolean array.- Specified by:
toArrayin interfaceBooleanIterable
-
toArray
public boolean[] toArray(boolean[] array)
Description copied from interface:BooleanIterableConverts 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:
toArrayin interfaceBooleanIterable
-
-