Class SynchronizedBooleanList
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedBooleanCollection
-
- org.eclipse.collections.impl.list.mutable.primitive.SynchronizedBooleanList
-
- All Implemented Interfaces:
java.io.Serializable
,BooleanIterable
,MutableBooleanCollection
,BooleanList
,MutableBooleanList
,OrderedBooleanIterable
,ReversibleBooleanIterable
,PrimitiveIterable
public class SynchronizedBooleanList extends AbstractSynchronizedBooleanCollection implements MutableBooleanList
A synchronized view of aMutableBooleanList
. It is imperative that the user manually synchronize on the on the collection when iterating over it using an iterator or stream.This file was automatically generated from template file synchronizedPrimitiveList.stg.
- Since:
- 3.1.
- See Also:
MutableBooleanList.asSynchronized()
,MutableList.asSynchronized()
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SynchronizedBooleanList(MutableBooleanList list)
SynchronizedBooleanList(MutableBooleanList list, java.lang.Object newLock)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAllAtIndex(int index, boolean... source)
boolean
addAllAtIndex(int index, BooleanIterable source)
void
addAtIndex(int index, boolean element)
LazyBooleanIterable
asLazy()
Returns a LazyBooleanIterable adapter wrapping the source BooleanIterable.LazyBooleanIterable
asReversed()
MutableBooleanList
asSynchronized()
MutableBooleanList
asUnmodifiable()
<V> MutableList<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.<V> MutableList<V>
collectWithIndex(BooleanIntToObjectFunction<? extends V> function)
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.<V,R extends java.util.Collection<V>>
RcollectWithIndex(BooleanIntToObjectFunction<? extends V> function, R target)
Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.MutableBooleanList
distinct()
boolean
equals(java.lang.Object otherList)
Follows the same general contract asList.equals(Object)
.void
forEachInBoth(BooleanList other, BooleanBooleanProcedure procedure)
This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.void
forEachWithIndex(BooleanIntProcedure procedure)
boolean
get(int index)
boolean
getFirst()
boolean
getLast()
private MutableBooleanList
getMutableBooleanList()
int
hashCode()
Follows the same general contract asList.hashCode()
.int
indexOf(boolean value)
<T> T
injectIntoWithIndex(T injectedValue, ObjectBooleanIntToObjectFunction<? super T,? extends T> function)
int
lastIndexOf(boolean value)
MutableBooleanList
newEmpty()
Creates a new empty mutable version of the same List type.MutableBooleanList
reject(BooleanPredicate predicate)
Returns a new BooleanIterable with all of the elements in the BooleanIterable that return false for the specified predicate.MutableBooleanList
rejectWithIndex(BooleanIntPredicate predicate)
Returns a new MutableBooleanList excluding all elements with corresponding indexes matching the specified predicate.<R extends MutableBooleanCollection>
RrejectWithIndex(BooleanIntPredicate predicate, R target)
Returns a new MutableBooleanCollection excluding all elements with corresponding indexes matching the specified predicate.boolean
removeAtIndex(int index)
MutableBooleanList
reverseThis()
MutableBooleanList
select(BooleanPredicate predicate)
Returns a new BooleanIterable with all of the elements in the BooleanIterable that return true for the specified predicate.MutableBooleanList
selectWithIndex(BooleanIntPredicate predicate)
Returns a new MutableBooleanList including all elements with corresponding indexes matching the specified predicate.<R extends MutableBooleanCollection>
RselectWithIndex(BooleanIntPredicate predicate, R target)
Returns a new MutableBooleanCollection including all elements with corresponding indexes matching the specified predicate.boolean
set(int index, boolean element)
MutableBooleanList
subList(int fromIndex, int toIndex)
ImmutableBooleanList
toImmutable()
Returns an immutable copy of this list.MutableBooleanList
toReversed()
SynchronizedBooleanList
with(boolean element)
SynchronizedBooleanList
withAll(BooleanIterable elements)
SynchronizedBooleanList
without(boolean element)
SynchronizedBooleanList
withoutAll(BooleanIterable elements)
<T> MutableList<BooleanObjectPair<T>>
zip(java.lang.Iterable<T> iterable)
Returns aMutableList
formed from thisMutableBooleanList
and aListIterable
by combining corresponding elements in pairs.MutableList<BooleanBooleanPair>
zipBoolean(BooleanIterable iterable)
Returns aMutableList
formed from thisMutableBooleanList
and anotherBooleanList
by combining corresponding elements in pairs.-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedBooleanCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, booleanIterator, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getBooleanCollection, getLock, injectInto, isEmpty, makeString, makeString, makeString, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, toArray, toArray, toBag, toList, toSet, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.BooleanIterable
allSatisfy, anySatisfy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, noneSatisfy, reduce, reduceIfEmpty, reject, select, toArray, toArray, toBag, toList, toSet
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableBooleanCollection
add, addAll, addAll, booleanIterator, clear, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableBooleanList
swap, tap
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SynchronizedBooleanList
public SynchronizedBooleanList(MutableBooleanList list)
-
SynchronizedBooleanList
public SynchronizedBooleanList(MutableBooleanList list, java.lang.Object newLock)
-
-
Method Detail
-
getMutableBooleanList
private MutableBooleanList getMutableBooleanList()
-
get
public boolean get(int index)
- Specified by:
get
in interfaceBooleanList
-
getFirst
public boolean getFirst()
- Specified by:
getFirst
in interfaceOrderedBooleanIterable
-
getLast
public boolean getLast()
- Specified by:
getLast
in interfaceReversibleBooleanIterable
-
indexOf
public int indexOf(boolean value)
- Specified by:
indexOf
in interfaceOrderedBooleanIterable
-
lastIndexOf
public int lastIndexOf(boolean value)
- Specified by:
lastIndexOf
in interfaceBooleanList
-
addAtIndex
public void addAtIndex(int index, boolean element)
- Specified by:
addAtIndex
in interfaceMutableBooleanList
-
addAllAtIndex
public boolean addAllAtIndex(int index, boolean... source)
- Specified by:
addAllAtIndex
in interfaceMutableBooleanList
-
addAllAtIndex
public boolean addAllAtIndex(int index, BooleanIterable source)
- Specified by:
addAllAtIndex
in interfaceMutableBooleanList
-
removeAtIndex
public boolean removeAtIndex(int index)
- Specified by:
removeAtIndex
in interfaceMutableBooleanList
-
set
public boolean set(int index, boolean element)
- Specified by:
set
in interfaceMutableBooleanList
-
with
public SynchronizedBooleanList with(boolean element)
- Specified by:
with
in interfaceMutableBooleanCollection
- Specified by:
with
in interfaceMutableBooleanList
- Overrides:
with
in classAbstractSynchronizedBooleanCollection
-
without
public SynchronizedBooleanList without(boolean element)
- Specified by:
without
in interfaceMutableBooleanCollection
- Specified by:
without
in interfaceMutableBooleanList
- Overrides:
without
in classAbstractSynchronizedBooleanCollection
-
withAll
public SynchronizedBooleanList withAll(BooleanIterable elements)
- Specified by:
withAll
in interfaceMutableBooleanCollection
- Specified by:
withAll
in interfaceMutableBooleanList
- Overrides:
withAll
in classAbstractSynchronizedBooleanCollection
-
withoutAll
public SynchronizedBooleanList withoutAll(BooleanIterable elements)
- Specified by:
withoutAll
in interfaceMutableBooleanCollection
- Specified by:
withoutAll
in interfaceMutableBooleanList
- Overrides:
withoutAll
in classAbstractSynchronizedBooleanCollection
-
select
public MutableBooleanList 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 interfaceBooleanList
- Specified by:
select
in interfaceMutableBooleanCollection
- Specified by:
select
in interfaceMutableBooleanList
- Specified by:
select
in interfaceOrderedBooleanIterable
- Specified by:
select
in interfaceReversibleBooleanIterable
- Overrides:
select
in classAbstractSynchronizedBooleanCollection
-
reject
public MutableBooleanList 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 interfaceBooleanList
- Specified by:
reject
in interfaceMutableBooleanCollection
- Specified by:
reject
in interfaceMutableBooleanList
- Specified by:
reject
in interfaceOrderedBooleanIterable
- Specified by:
reject
in interfaceReversibleBooleanIterable
- Overrides:
reject
in classAbstractSynchronizedBooleanCollection
-
collect
public <V> MutableList<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 interfaceBooleanList
- Specified by:
collect
in interfaceMutableBooleanCollection
- Specified by:
collect
in interfaceMutableBooleanList
- Specified by:
collect
in interfaceOrderedBooleanIterable
- Specified by:
collect
in interfaceReversibleBooleanIterable
- Overrides:
collect
in classAbstractSynchronizedBooleanCollection
-
equals
public boolean equals(java.lang.Object otherList)
Description copied from interface:BooleanList
Follows the same general contract asList.equals(Object)
.- Specified by:
equals
in interfaceBooleanList
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
Description copied from interface:BooleanList
Follows the same general contract asList.hashCode()
.- Specified by:
hashCode
in interfaceBooleanList
- Overrides:
hashCode
in classjava.lang.Object
-
asLazy
public LazyBooleanIterable asLazy()
Description copied from interface:BooleanIterable
Returns a LazyBooleanIterable adapter wrapping the source BooleanIterable.- Specified by:
asLazy
in interfaceBooleanIterable
- Overrides:
asLazy
in classAbstractSynchronizedBooleanCollection
-
asUnmodifiable
public MutableBooleanList asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableBooleanCollection
- Specified by:
asUnmodifiable
in interfaceMutableBooleanList
- Overrides:
asUnmodifiable
in classAbstractSynchronizedBooleanCollection
-
asSynchronized
public MutableBooleanList asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableBooleanCollection
- Specified by:
asSynchronized
in interfaceMutableBooleanList
- Overrides:
asSynchronized
in classAbstractSynchronizedBooleanCollection
-
toImmutable
public ImmutableBooleanList toImmutable()
Description copied from interface:MutableBooleanList
Returns an immutable copy of this list.- Specified by:
toImmutable
in interfaceBooleanList
- Specified by:
toImmutable
in interfaceMutableBooleanCollection
- Specified by:
toImmutable
in interfaceMutableBooleanList
- Overrides:
toImmutable
in classAbstractSynchronizedBooleanCollection
-
newEmpty
public MutableBooleanList newEmpty()
Description copied from interface:MutableBooleanList
Creates a new empty mutable version of the same List type.- Specified by:
newEmpty
in interfaceMutableBooleanCollection
- Specified by:
newEmpty
in interfaceMutableBooleanList
- Since:
- 9.2.
-
reverseThis
public MutableBooleanList reverseThis()
- Specified by:
reverseThis
in interfaceMutableBooleanList
-
toReversed
public MutableBooleanList toReversed()
- Specified by:
toReversed
in interfaceBooleanList
- Specified by:
toReversed
in interfaceMutableBooleanList
- Specified by:
toReversed
in interfaceReversibleBooleanIterable
-
asReversed
public LazyBooleanIterable asReversed()
- Specified by:
asReversed
in interfaceReversibleBooleanIterable
-
forEachInBoth
public void forEachInBoth(BooleanList other, BooleanBooleanProcedure procedure)
Description copied from interface:BooleanList
This method iterates over two CharList instances of the same size together using the specified CharCharProcedure.- Specified by:
forEachInBoth
in interfaceBooleanList
-
forEachWithIndex
public void forEachWithIndex(BooleanIntProcedure procedure)
- Specified by:
forEachWithIndex
in interfaceOrderedBooleanIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectBooleanIntToObjectFunction<? super T,? extends T> function)
- Specified by:
injectIntoWithIndex
in interfaceOrderedBooleanIterable
- Specified by:
injectIntoWithIndex
in interfaceReversibleBooleanIterable
-
distinct
public MutableBooleanList distinct()
- Specified by:
distinct
in interfaceBooleanList
- Specified by:
distinct
in interfaceMutableBooleanList
- Specified by:
distinct
in interfaceReversibleBooleanIterable
- Since:
- 6.0.
-
subList
public MutableBooleanList subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceBooleanList
- Specified by:
subList
in interfaceMutableBooleanList
- See Also:
List.subList(int fromIndex, int toIndex)
-
zipBoolean
public MutableList<BooleanBooleanPair> zipBoolean(BooleanIterable iterable)
Description copied from interface:MutableBooleanList
Returns aMutableList
formed from thisMutableBooleanList
and anotherBooleanList
by combining corresponding elements in pairs. If one of the twoBooleanList
s is longer than the other, its remaining elements are ignored.- Specified by:
zipBoolean
in interfaceBooleanList
- Specified by:
zipBoolean
in interfaceMutableBooleanList
- Since:
- 9.1.
-
zip
public <T> MutableList<BooleanObjectPair<T>> zip(java.lang.Iterable<T> iterable)
Description copied from interface:MutableBooleanList
Returns aMutableList
formed from thisMutableBooleanList
and aListIterable
by combining corresponding elements in pairs. If one of the two Lists is longer than the other, its remaining elements are ignored.- Specified by:
zip
in interfaceBooleanList
- Specified by:
zip
in interfaceMutableBooleanList
- Since:
- 9.1.
-
selectWithIndex
public MutableBooleanList selectWithIndex(BooleanIntPredicate predicate)
Returns a new MutableBooleanList including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceBooleanList
- Specified by:
selectWithIndex
in interfaceMutableBooleanList
- Specified by:
selectWithIndex
in interfaceOrderedBooleanIterable
- Specified by:
selectWithIndex
in interfaceReversibleBooleanIterable
- Since:
- 11.1.
-
selectWithIndex
public <R extends MutableBooleanCollection> R selectWithIndex(BooleanIntPredicate predicate, R target)
Returns a new MutableBooleanCollection including all elements with corresponding indexes matching the specified predicate.- Specified by:
selectWithIndex
in interfaceOrderedBooleanIterable
- Since:
- 11.1.
-
rejectWithIndex
public MutableBooleanList rejectWithIndex(BooleanIntPredicate predicate)
Returns a new MutableBooleanList excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceBooleanList
- Specified by:
rejectWithIndex
in interfaceMutableBooleanList
- Specified by:
rejectWithIndex
in interfaceOrderedBooleanIterable
- Specified by:
rejectWithIndex
in interfaceReversibleBooleanIterable
- Since:
- 11.1.
-
rejectWithIndex
public <R extends MutableBooleanCollection> R rejectWithIndex(BooleanIntPredicate predicate, R target)
Returns a new MutableBooleanCollection excluding all elements with corresponding indexes matching the specified predicate.- Specified by:
rejectWithIndex
in interfaceOrderedBooleanIterable
- Since:
- 11.1.
-
collectWithIndex
public <V> MutableList<V> collectWithIndex(BooleanIntToObjectFunction<? extends V> function)
Returns a new MutableList using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndex
in interfaceBooleanList
- Specified by:
collectWithIndex
in interfaceMutableBooleanList
- Specified by:
collectWithIndex
in interfaceOrderedBooleanIterable
- Specified by:
collectWithIndex
in interfaceReversibleBooleanIterable
- Since:
- 9.1.
-
collectWithIndex
public <V,R extends java.util.Collection<V>> R collectWithIndex(BooleanIntToObjectFunction<? extends V> function, R target)
Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index.- Specified by:
collectWithIndex
in interfaceOrderedBooleanIterable
- Since:
- 9.1.
-
-