Class BooleanArrayList
- java.lang.Object
-
- org.eclipse.collections.impl.list.mutable.primitive.BooleanArrayList
-
- All Implemented Interfaces:
Externalizable,Serializable,BooleanIterable,MutableBooleanCollection,BooleanList,MutableBooleanList,OrderedBooleanIterable,ReversibleBooleanIterable,PrimitiveIterable
public final class BooleanArrayList extends Object implements MutableBooleanList, Externalizable
BooleanArrayList is similar toFastList, and is memory-optimized for boolean primitives.- Since:
- 3.0.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BooleanArrayList()BooleanArrayList(boolean... array)BooleanArrayList(int initialCapacity)
-
Method Summary
-
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.list.primitive.BooleanList
forEachInBoth
-
Methods inherited from interface org.eclipse.collections.api.list.primitive.MutableBooleanList
collectWithIndex, newEmpty, rejectWithIndex, selectWithIndex, swap, tap, zip, zipBoolean
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedBooleanIterable
collectWithIndex, rejectWithIndex, selectWithIndex
-
-
-
-
Method Detail
-
newListWith
public static BooleanArrayList newListWith(boolean... array)
-
newList
public static BooleanArrayList newList(BooleanIterable source)
-
newWithNValues
public static BooleanArrayList newWithNValues(int size, boolean value)
- Since:
- 8.0
-
size
public int size()
- Specified by:
sizein interfacePrimitiveIterable
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacePrimitiveIterable
-
notEmpty
public boolean notEmpty()
- Specified by:
notEmptyin interfacePrimitiveIterable
-
clear
public void clear()
- Specified by:
clearin 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
-
get
public boolean get(int index)
- Specified by:
getin interfaceBooleanList
-
getFirst
public boolean getFirst()
- Specified by:
getFirstin interfaceOrderedBooleanIterable
-
getLast
public boolean getLast()
- Specified by:
getLastin interfaceReversibleBooleanIterable
-
indexOf
public int indexOf(boolean object)
- Specified by:
indexOfin interfaceOrderedBooleanIterable
-
lastIndexOf
public int lastIndexOf(boolean object)
- Specified by:
lastIndexOfin interfaceBooleanList
-
add
public boolean add(boolean newItem)
- Specified by:
addin interfaceMutableBooleanCollection
-
addAll
public boolean addAll(boolean... source)
- Specified by:
addAllin interfaceMutableBooleanCollection
-
addAll
public boolean addAll(BooleanIterable source)
- Specified by:
addAllin interfaceMutableBooleanCollection
-
addAtIndex
public void addAtIndex(int index, boolean element)- Specified by:
addAtIndexin interfaceMutableBooleanList
-
addAllAtIndex
public boolean addAllAtIndex(int index, boolean... source)- Specified by:
addAllAtIndexin interfaceMutableBooleanList
-
addAllAtIndex
public boolean addAllAtIndex(int index, BooleanIterable source)- Specified by:
addAllAtIndexin interfaceMutableBooleanList
-
remove
public boolean remove(boolean value)
- Specified by:
removein interfaceMutableBooleanCollection
-
removeIf
public boolean removeIf(BooleanPredicate predicate)
- Specified by:
removeIfin interfaceMutableBooleanCollection
-
removeAll
public boolean removeAll(BooleanIterable source)
- Specified by:
removeAllin interfaceMutableBooleanCollection
-
removeAll
public boolean removeAll(boolean... source)
- Specified by:
removeAllin interfaceMutableBooleanCollection
-
retainAll
public boolean retainAll(BooleanIterable source)
- Specified by:
retainAllin interfaceMutableBooleanCollection
-
retainAll
public boolean retainAll(boolean... source)
- Specified by:
retainAllin interfaceMutableBooleanCollection
-
removeAtIndex
public boolean removeAtIndex(int index)
- Specified by:
removeAtIndexin interfaceMutableBooleanList
-
set
public boolean set(int index, boolean element)- Specified by:
setin interfaceMutableBooleanList
-
with
public BooleanArrayList with(boolean element)
- Specified by:
within interfaceMutableBooleanCollection- Specified by:
within interfaceMutableBooleanList
-
without
public BooleanArrayList without(boolean element)
- Specified by:
withoutin interfaceMutableBooleanCollection- Specified by:
withoutin interfaceMutableBooleanList
-
withAll
public BooleanArrayList withAll(BooleanIterable elements)
- Specified by:
withAllin interfaceMutableBooleanCollection- Specified by:
withAllin interfaceMutableBooleanList
-
withoutAll
public BooleanArrayList withoutAll(BooleanIterable elements)
- Specified by:
withoutAllin interfaceMutableBooleanCollection- Specified by:
withoutAllin interfaceMutableBooleanList
-
with
public BooleanArrayList with(boolean element1, boolean element2)
-
with
public BooleanArrayList with(boolean element1, boolean element2, boolean element3)
-
with
public BooleanArrayList with(boolean element1, boolean element2, boolean element3, boolean... elements)
-
booleanIterator
public MutableBooleanIterator booleanIterator()
- Specified by:
booleanIteratorin interfaceBooleanIterable- Specified by:
booleanIteratorin interfaceMutableBooleanCollection
-
each
public void each(BooleanProcedure procedure)
- Specified by:
eachin interfaceBooleanIterable- Since:
- 7.0.
-
forEachWithIndex
public void forEachWithIndex(BooleanIntProcedure procedure)
- Specified by:
forEachWithIndexin interfaceOrderedBooleanIterable
-
injectInto
public <T> T injectInto(T injectedValue, ObjectBooleanToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoin interfaceBooleanIterable
-
injectIntoWithIndex
public <T> T injectIntoWithIndex(T injectedValue, ObjectBooleanIntToObjectFunction<? super T,? extends T> function)- Specified by:
injectIntoWithIndexin interfaceOrderedBooleanIterable- Specified by:
injectIntoWithIndexin interfaceReversibleBooleanIterable
-
chunk
public RichIterable<BooleanIterable> chunk(int size)
- Specified by:
chunkin interfaceBooleanIterable
-
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
-
select
public BooleanArrayList select(BooleanPredicate predicate)
- Specified by:
selectin interfaceBooleanIterable- Specified by:
selectin interfaceBooleanList- Specified by:
selectin interfaceMutableBooleanCollection- Specified by:
selectin interfaceMutableBooleanList- Specified by:
selectin interfaceOrderedBooleanIterable- Specified by:
selectin interfaceReversibleBooleanIterable
-
reject
public BooleanArrayList reject(BooleanPredicate predicate)
- Specified by:
rejectin interfaceBooleanIterable- Specified by:
rejectin interfaceBooleanList- Specified by:
rejectin interfaceMutableBooleanCollection- Specified by:
rejectin interfaceMutableBooleanList- Specified by:
rejectin interfaceOrderedBooleanIterable- Specified by:
rejectin interfaceReversibleBooleanIterable
-
asReversed
public LazyBooleanIterable asReversed()
- Specified by:
asReversedin interfaceReversibleBooleanIterable
-
reverseThis
public BooleanArrayList reverseThis()
- Specified by:
reverseThisin interfaceMutableBooleanList
-
asUnmodifiable
public MutableBooleanList asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableBooleanCollection- Specified by:
asUnmodifiablein interfaceMutableBooleanList
-
asSynchronized
public MutableBooleanList asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableBooleanCollection- Specified by:
asSynchronizedin interfaceMutableBooleanList
-
toImmutable
public ImmutableBooleanList toImmutable()
- Specified by:
toImmutablein interfaceBooleanList- Specified by:
toImmutablein interfaceMutableBooleanCollection- Specified by:
toImmutablein interfaceMutableBooleanList
-
subList
public MutableBooleanList subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceBooleanList- Specified by:
subListin interfaceMutableBooleanList
-
toReversed
public BooleanArrayList toReversed()
- Specified by:
toReversedin interfaceBooleanList- Specified by:
toReversedin interfaceMutableBooleanList- Specified by:
toReversedin interfaceReversibleBooleanIterable
-
distinct
public MutableBooleanList distinct()
- Specified by:
distinctin interfaceBooleanList- Specified by:
distinctin interfaceMutableBooleanList- Specified by:
distinctin interfaceReversibleBooleanIterable- Since:
- 6.0
-
detectIfNone
public boolean detectIfNone(BooleanPredicate predicate, boolean ifNone)
- Specified by:
detectIfNonein interfaceBooleanIterable
-
collect
public <V> MutableList<V> collect(BooleanToObjectFunction<? extends V> function)
- Specified by:
collectin interfaceBooleanIterable- Specified by:
collectin interfaceBooleanList- Specified by:
collectin interfaceMutableBooleanCollection- Specified by:
collectin interfaceMutableBooleanList- Specified by:
collectin interfaceOrderedBooleanIterable- Specified by:
collectin interfaceReversibleBooleanIterable
-
toArray
public boolean[] toArray()
- Specified by:
toArrayin interfaceBooleanIterable
-
toArray
public boolean[] toArray(boolean[] target)
- Specified by:
toArrayin interfaceBooleanIterable
-
equals
public boolean equals(Object otherList)
- Specified by:
equalsin interfaceBooleanList- Overrides:
equalsin classObject
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceBooleanList- 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
-
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
-
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
-
boxed
public MutableList<Boolean> boxed()
- Specified by:
boxedin interfaceMutableBooleanList
-
-