Externalizable, Serializable, BooleanIterable, MutableBooleanCollection, BooleanList, MutableBooleanList, OrderedBooleanIterable, ReversibleBooleanIterable, PrimitiveIterablepublic final class BooleanArrayList extends Object implements MutableBooleanList, Externalizable
FastList, and is memory-optimized for boolean primitives.| Constructor | Description |
|---|---|
BooleanArrayList() |
|
BooleanArrayList(boolean... array) |
|
BooleanArrayList(int initialCapacity) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
add(boolean newItem) |
|
boolean |
addAll(boolean... source) |
|
boolean |
addAll(BooleanIterable source) |
|
boolean |
addAllAtIndex(int index,
boolean... source) |
|
boolean |
addAllAtIndex(int index,
BooleanIterable source) |
|
void |
addAtIndex(int index,
boolean element) |
|
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(Appendable appendable) |
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String separator) |
Prints a string representation of this collection onto the given
Appendable. |
void |
appendString(Appendable appendable,
String start,
String separator,
String end) |
Prints a string representation of this collection onto the given
Appendable. |
LazyBooleanIterable |
asLazy() |
Returns a LazyBooleanIterable adapter wrapping the source BooleanIterable.
|
LazyBooleanIterable |
asReversed() |
|
MutableBooleanList |
asSynchronized() |
|
MutableBooleanList |
asUnmodifiable() |
|
MutableBooleanIterator |
booleanIterator() |
Returns a primitive iterator that can be used to iterate over the BooleanIterable in an
imperative style.
|
RichIterable<BooleanIterable> |
chunk(int size) |
Partitions elements in fixed size chunks.
|
void |
clear() |
|
<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.
|
boolean |
contains(boolean value) |
Returns true if the value is contained in the BooleanIterable, and false if it is not.
|
boolean |
containsAll(boolean... source) |
Returns true if the all of the values specified in the source array are contained
in the BooleanIterable, and false if they are not.
|
boolean |
containsAll(BooleanIterable source) |
Returns true if the 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 ifNone) |
|
MutableBooleanList |
distinct() |
|
void |
each(BooleanProcedure procedure) |
A synonym for forEach.
|
boolean |
equals(Object otherList) |
Follows the same general contract as
List.equals(Object). |
void |
forEach(BooleanProcedure procedure) |
Applies the BooleanProcedure to each element in the BooleanIterable.
|
void |
forEachWithIndex(BooleanIntProcedure procedure) |
|
boolean |
get(int index) |
|
boolean |
getFirst() |
|
boolean |
getLast() |
|
int |
hashCode() |
Follows the same general contract as
List.hashCode(). |
int |
indexOf(boolean object) |
|
<T> T |
injectInto(T injectedValue,
ObjectBooleanToObjectFunction<? super T,? extends T> function) |
|
<T> T |
injectIntoWithIndex(T injectedValue,
ObjectBooleanIntToObjectFunction<? super T,? extends T> function) |
|
boolean |
isEmpty() |
Returns true if this iterable has zero items.
|
int |
lastIndexOf(boolean object) |
|
String |
makeString() |
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space). |
String |
makeString(String separator) |
Returns a string representation of this collection by delegating to
PrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String). |
String |
makeString(String start,
String separator,
String end) |
Returns a string representation of this collection with the elements separated by the specified
separator and enclosed between the start and end strings.
|
static BooleanArrayList |
newList(BooleanIterable source) |
|
static BooleanArrayList |
newListWith(boolean... array) |
|
static BooleanArrayList |
newWithNValues(int size,
boolean value) |
|
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()
|
void |
readExternal(ObjectInput in) |
|
BooleanArrayList |
reject(BooleanPredicate predicate) |
Returns a new BooleanIterable with all of the elements in the BooleanIterable that
return false for the specified predicate.
|
boolean |
remove(boolean value) |
|
boolean |
removeAll(boolean... source) |
|
boolean |
removeAll(BooleanIterable source) |
|
boolean |
removeAtIndex(int index) |
|
boolean |
removeIf(BooleanPredicate predicate) |
|
boolean |
retainAll(boolean... source) |
|
boolean |
retainAll(BooleanIterable source) |
|
BooleanArrayList |
reverseThis() |
|
BooleanArrayList |
select(BooleanPredicate predicate) |
Returns a new BooleanIterable with all of the elements in the BooleanIterable that
return true for the specified predicate.
|
boolean |
set(int index,
boolean element) |
|
int |
size() |
Returns the number of items in this iterable.
|
MutableBooleanList |
subList(int fromIndex,
int toIndex) |
|
boolean[] |
toArray() |
Converts the BooleanIterable to a primitive boolean array.
|
MutableBooleanBag |
toBag() |
Converts the BooleanIterable to a new MutableBooleanBag.
|
ImmutableBooleanList |
toImmutable() |
Returns an immutable copy of this list.
|
MutableBooleanList |
toList() |
Converts the BooleanIterable to a new MutableBooleanList.
|
BooleanArrayList |
toReversed() |
|
MutableBooleanSet |
toSet() |
Converts the BooleanIterable to a new MutableBooleanSet.
|
String |
toString() |
Returns a string with the elements of this iterable separated by commas with spaces and
enclosed in square brackets.
|
BooleanArrayList |
with(boolean element) |
|
BooleanArrayList |
with(boolean element1,
boolean element2) |
|
BooleanArrayList |
with(boolean element1,
boolean element2,
boolean element3) |
|
BooleanArrayList |
with(boolean element1,
boolean element2,
boolean element3,
boolean... elements) |
|
BooleanArrayList |
withAll(BooleanIterable elements) |
|
BooleanArrayList |
without(boolean element) |
|
BooleanArrayList |
withoutAll(BooleanIterable elements) |
|
void |
writeExternal(ObjectOutput out) |
collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, flatCollect, reduce, reduceIfEmpty, reject, selectcollectWithIndex, newEmpty, tap, zip, zipBooleancollectWithIndexpublic BooleanArrayList()
public BooleanArrayList(int initialCapacity)
public BooleanArrayList(boolean... array)
public static BooleanArrayList newListWith(boolean... array)
public static BooleanArrayList newList(BooleanIterable source)
public static BooleanArrayList newWithNValues(int size, boolean value)
public int size()
PrimitiveIterablesize in interface PrimitiveIterablepublic boolean isEmpty()
PrimitiveIterableisEmpty in interface PrimitiveIterablepublic boolean notEmpty()
PrimitiveIterablenotEmpty in interface PrimitiveIterablepublic void clear()
clear in interface MutableBooleanCollectionpublic boolean contains(boolean value)
BooleanIterablecontains in interface BooleanIterablepublic boolean containsAll(boolean... source)
BooleanIterablecontainsAll in interface BooleanIterablepublic boolean containsAll(BooleanIterable source)
BooleanIterablecontainsAll in interface BooleanIterablepublic boolean get(int index)
get in interface BooleanListpublic boolean getFirst()
getFirst in interface OrderedBooleanIterablepublic boolean getLast()
getLast in interface ReversibleBooleanIterablepublic int indexOf(boolean object)
indexOf in interface OrderedBooleanIterablepublic int lastIndexOf(boolean object)
lastIndexOf in interface BooleanListpublic boolean add(boolean newItem)
add in interface MutableBooleanCollectionpublic boolean addAll(boolean... source)
addAll in interface MutableBooleanCollectionpublic boolean addAll(BooleanIterable source)
addAll in interface MutableBooleanCollectionpublic void addAtIndex(int index,
boolean element)
addAtIndex in interface MutableBooleanListpublic boolean addAllAtIndex(int index,
boolean... source)
addAllAtIndex in interface MutableBooleanListpublic boolean addAllAtIndex(int index,
BooleanIterable source)
addAllAtIndex in interface MutableBooleanListpublic boolean remove(boolean value)
remove in interface MutableBooleanCollectionpublic boolean removeIf(BooleanPredicate predicate)
removeIf in interface MutableBooleanCollectionpublic boolean removeAll(BooleanIterable source)
removeAll in interface MutableBooleanCollectionpublic boolean removeAll(boolean... source)
removeAll in interface MutableBooleanCollectionpublic boolean retainAll(BooleanIterable source)
retainAll in interface MutableBooleanCollectionCollection.retainAll(Collection)public boolean retainAll(boolean... source)
retainAll in interface MutableBooleanCollectionCollection.retainAll(Collection)public boolean removeAtIndex(int index)
removeAtIndex in interface MutableBooleanListpublic boolean set(int index,
boolean element)
set in interface MutableBooleanListpublic BooleanArrayList with(boolean element)
with in interface MutableBooleanCollectionwith in interface MutableBooleanListpublic BooleanArrayList without(boolean element)
without in interface MutableBooleanCollectionwithout in interface MutableBooleanListpublic BooleanArrayList withAll(BooleanIterable elements)
withAll in interface MutableBooleanCollectionwithAll in interface MutableBooleanListpublic BooleanArrayList withoutAll(BooleanIterable elements)
withoutAll in interface MutableBooleanCollectionwithoutAll in interface MutableBooleanListpublic BooleanArrayList with(boolean element1, boolean element2)
public BooleanArrayList with(boolean element1, boolean element2, boolean element3)
public BooleanArrayList with(boolean element1, boolean element2, boolean element3, boolean... elements)
public MutableBooleanIterator booleanIterator()
BooleanIterablebooleanIterator in interface BooleanIterablebooleanIterator in interface MutableBooleanCollectionpublic void forEach(BooleanProcedure procedure)
BooleanIterableforEach in interface BooleanIterablepublic void each(BooleanProcedure procedure)
BooleanIterableeach in interface BooleanIterablepublic void forEachWithIndex(BooleanIntProcedure procedure)
forEachWithIndex in interface OrderedBooleanIterablepublic <T> T injectInto(T injectedValue,
ObjectBooleanToObjectFunction<? super T,? extends T> function)
injectInto in interface BooleanIterablepublic <T> T injectIntoWithIndex(T injectedValue,
ObjectBooleanIntToObjectFunction<? super T,? extends T> function)
injectIntoWithIndex in interface OrderedBooleanIterableinjectIntoWithIndex in interface ReversibleBooleanIterablepublic RichIterable<BooleanIterable> chunk(int size)
BooleanIterablechunk in interface BooleanIterablesize - the number of elements per chunkRichIterable containing BooleanIterables of size size, except the last will be
truncated if the elements don't divide evenly.public int count(BooleanPredicate predicate)
BooleanIterablecount in interface BooleanIterablepublic boolean anySatisfy(BooleanPredicate predicate)
BooleanIterableanySatisfy in interface BooleanIterablepublic boolean allSatisfy(BooleanPredicate predicate)
BooleanIterableallSatisfy in interface BooleanIterablepublic boolean noneSatisfy(BooleanPredicate predicate)
BooleanIterablenoneSatisfy in interface BooleanIterablepublic BooleanArrayList select(BooleanPredicate predicate)
BooleanIterableselect in interface BooleanIterableselect in interface BooleanListselect in interface MutableBooleanCollectionselect in interface MutableBooleanListselect in interface OrderedBooleanIterableselect in interface ReversibleBooleanIterablepublic BooleanArrayList reject(BooleanPredicate predicate)
BooleanIterablereject in interface BooleanIterablereject in interface BooleanListreject in interface MutableBooleanCollectionreject in interface MutableBooleanListreject in interface OrderedBooleanIterablereject in interface ReversibleBooleanIterablepublic LazyBooleanIterable asReversed()
asReversed in interface ReversibleBooleanIterablepublic BooleanArrayList reverseThis()
reverseThis in interface MutableBooleanListpublic MutableBooleanList asUnmodifiable()
asUnmodifiable in interface MutableBooleanCollectionasUnmodifiable in interface MutableBooleanListpublic MutableBooleanList asSynchronized()
asSynchronized in interface MutableBooleanCollectionasSynchronized in interface MutableBooleanListpublic ImmutableBooleanList toImmutable()
MutableBooleanListtoImmutable in interface BooleanListtoImmutable in interface MutableBooleanCollectiontoImmutable in interface MutableBooleanListpublic MutableBooleanList subList(int fromIndex, int toIndex)
subList in interface BooleanListsubList in interface MutableBooleanListList.subList(int fromIndex, int toIndex)public BooleanArrayList toReversed()
toReversed in interface BooleanListtoReversed in interface MutableBooleanListtoReversed in interface ReversibleBooleanIterablepublic MutableBooleanList distinct()
distinct in interface BooleanListdistinct in interface MutableBooleanListdistinct in interface ReversibleBooleanIterablepublic boolean detectIfNone(BooleanPredicate predicate, boolean ifNone)
detectIfNone in interface BooleanIterablepublic <V> MutableList<V> collect(BooleanToObjectFunction<? extends V> function)
BooleanIterablecollect in interface BooleanIterablecollect in interface BooleanListcollect in interface MutableBooleanCollectioncollect in interface MutableBooleanListcollect in interface OrderedBooleanIterablecollect in interface ReversibleBooleanIterablepublic boolean[] toArray()
BooleanIterabletoArray in interface BooleanIterablepublic boolean equals(Object otherList)
BooleanListList.equals(Object).equals in interface BooleanListequals in class Objectpublic int hashCode()
BooleanListList.hashCode().hashCode in interface BooleanListhashCode in class Objectpublic String toString()
PrimitiveIterable
Assert.assertEquals("[]", IntLists.mutable.empty().toString());
Assert.assertEquals("[1]", IntLists.mutable.with(1).toString());
Assert.assertEquals("[1, 2, 3]", IntLists.mutable.with(1, 2, 3).toString());
toString in interface PrimitiveIterabletoString in class ObjectAbstractCollection.toString()public String makeString()
PrimitiveIterablePrimitiveIterable.makeString(String) and defaulting
the separator parameter to the characters ", " (comma and space).makeString in interface PrimitiveIterablepublic String makeString(String separator)
PrimitiveIterablePrimitiveIterable.makeString(String, String, String)
and defaulting the start and end parameters to "" (the empty String).makeString in interface PrimitiveIterablepublic String makeString(String start, String separator, String end)
PrimitiveIterablemakeString in interface PrimitiveIterablepublic void appendString(Appendable appendable)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString().appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String separator)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String).appendString in interface PrimitiveIterablepublic void appendString(Appendable appendable, String start, String separator, String end)
PrimitiveIterableAppendable. Prints the string returned
by PrimitiveIterable.makeString(String, String, String).appendString in interface PrimitiveIterablepublic MutableBooleanList toList()
BooleanIterabletoList in interface BooleanIterablepublic MutableBooleanSet toSet()
BooleanIterabletoSet in interface BooleanIterablepublic MutableBooleanBag toBag()
BooleanIterabletoBag in interface BooleanIterablepublic LazyBooleanIterable asLazy()
BooleanIterableasLazy in interface BooleanIterablepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionCopyright © 2004–2019. All rights reserved.