Class BooleanArrayStack
java.lang.Object
org.eclipse.collections.impl.stack.primitive.AbstractBooleanStack
org.eclipse.collections.impl.stack.mutable.primitive.BooleanArrayStack
- All Implemented Interfaces:
Externalizable
,Serializable
,BooleanIterable
,OrderedBooleanIterable
,PrimitiveIterable
,BooleanStack
,MutableBooleanStack
public class BooleanArrayStack extends AbstractBooleanStack implements MutableBooleanStack, Externalizable
BooleanArrayStack is similar to
ArrayStack
, and is memory-optimized for boolean primitives.
This file was automatically generated from template file primitiveArrayStack.stg.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description BooleanArrayStack()
-
Method Summary
Modifier and Type Method Description MutableBooleanStack
asSynchronized()
MutableBooleanStack
asUnmodifiable()
void
clear()
Clears the Stack<V> MutableStack<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
equals(Object otherStack)
Follows the same general contract asStackIterable.equals(Object)
.int
hashCode()
Follows the same general contract asStackIterable.hashCode()
.BooleanArrayStack
newEmpty()
Creates a new empty BooleanArrayStack.static BooleanArrayStack
newStack(BooleanIterable items)
static BooleanArrayStack
newStackFromTopToBottom(boolean... items)
static BooleanArrayStack
newStackFromTopToBottom(BooleanIterable items)
static BooleanArrayStack
newStackWith(boolean... items)
boolean
pop()
Removes and returns the top element of the stack.BooleanList
pop(int count)
Removes and returns a BooleanList of the number of elements specified by the count, beginning with the top of the stack.void
push(boolean item)
Adds an item to the top of the stack.void
readExternal(ObjectInput in)
MutableBooleanStack
reject(BooleanPredicate predicate)
Returns a new BooleanIterable with all of the elements in the BooleanIterable that return false for the specified predicate.MutableBooleanStack
select(BooleanPredicate predicate)
Returns a new BooleanIterable with all of the elements in the BooleanIterable that return true for the specified predicate.ImmutableBooleanStack
toImmutable()
void
writeExternal(ObjectOutput out)
Methods inherited from class org.eclipse.collections.impl.stack.primitive.AbstractBooleanStack
allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, booleanIterator, chunk, contains, containsAll, containsAll, count, detectIfNone, each, forEach, forEachWithIndex, getFirst, indexOf, injectInto, injectIntoWithIndex, makeString, makeString, makeString, noneSatisfy, peek, peek, peekAt, size, toArray, toArray, toBag, toList, toSet, toString
Methods inherited from interface org.eclipse.collections.api.BooleanIterable
allSatisfy, anySatisfy, asLazy, booleanIterator, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, noneSatisfy, reduce, reduceIfEmpty, reject, select, toArray, toArray, toBag, toList, toSet
Methods inherited from interface org.eclipse.collections.api.stack.primitive.BooleanStack
peek, peek, peekAt
Methods inherited from interface org.eclipse.collections.api.stack.primitive.MutableBooleanStack
collectWithIndex, tap
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedBooleanIterable
collectWithIndex, forEachWithIndex, getFirst, indexOf, injectIntoWithIndex
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Constructor Details
-
BooleanArrayStack
public BooleanArrayStack()
-
-
Method Details
-
newStackFromTopToBottom
-
newStackWith
-
newStack
-
newStackFromTopToBottom
-
push
public void push(boolean item)Description copied from interface:MutableBooleanStack
Adds an item to the top of the stack.- Specified by:
push
in interfaceMutableBooleanStack
-
pop
public boolean pop()Description copied from interface:MutableBooleanStack
Removes and returns the top element of the stack.- Specified by:
pop
in interfaceMutableBooleanStack
-
pop
Description copied from interface:MutableBooleanStack
Removes and returns a BooleanList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
pop
in interfaceMutableBooleanStack
-
select
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 interfaceBooleanStack
- Specified by:
select
in interfaceMutableBooleanStack
- Specified by:
select
in interfaceOrderedBooleanIterable
-
reject
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 interfaceBooleanStack
- Specified by:
reject
in interfaceMutableBooleanStack
- Specified by:
reject
in interfaceOrderedBooleanIterable
-
collect
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 interfaceBooleanStack
- Specified by:
collect
in interfaceMutableBooleanStack
- Specified by:
collect
in interfaceOrderedBooleanIterable
-
clear
public void clear()Description copied from interface:MutableBooleanStack
Clears the Stack- Specified by:
clear
in interfaceMutableBooleanStack
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableBooleanStack
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableBooleanStack
-
toImmutable
- Specified by:
toImmutable
in interfaceBooleanStack
-
newEmpty
Creates a new empty BooleanArrayStack.- Specified by:
newEmpty
in interfaceMutableBooleanStack
- Since:
- 9.2.
-
equals
Description copied from interface:BooleanStack
Follows the same general contract asStackIterable.equals(Object)
.- Specified by:
equals
in interfaceBooleanStack
- Overrides:
equals
in classAbstractBooleanStack
-
hashCode
public int hashCode()Description copied from interface:BooleanStack
Follows the same general contract asStackIterable.hashCode()
.- Specified by:
hashCode
in interfaceBooleanStack
- Overrides:
hashCode
in classAbstractBooleanStack
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-