Class BooleanArrayStack
- java.lang.Object
-
- org.eclipse.collections.impl.stack.primitive.AbstractBooleanStack
-
- org.eclipse.collections.impl.stack.mutable.primitive.BooleanArrayStack
-
- All Implemented Interfaces:
java.io.Externalizable
,java.io.Serializable
,BooleanIterable
,OrderedBooleanIterable
,PrimitiveIterable
,BooleanStack
,MutableBooleanStack
public class BooleanArrayStack extends AbstractBooleanStack implements MutableBooleanStack, java.io.Externalizable
BooleanArrayStack is similar toArrayStack
, and is memory-optimized for boolean primitives. This file was automatically generated from template file primitiveArrayStack.stg.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private BooleanArrayList
delegate
private static long
serialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description BooleanArrayStack()
private
BooleanArrayStack(boolean... items)
private
BooleanArrayStack(int size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods 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(java.lang.Object otherStack)
Follows the same general contract asStackIterable.equals(Object)
.protected BooleanArrayList
getDelegate()
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(java.io.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(java.io.ObjectOutput out)
-
Methods inherited from class org.eclipse.collections.impl.stack.primitive.AbstractBooleanStack
allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, booleanIterator, checkEmptyStack, checkPositiveValueForCount, checkSizeLessThanCount, chunk, contains, containsAll, containsAll, count, detectIfNone, each, forEachWithIndex, getFirst, indexOf, injectInto, injectIntoWithIndex, makeString, makeString, makeString, noneSatisfy, peek, peek, peekAt, rangeCheck, 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, asLazy, booleanIterator, 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.stack.primitive.BooleanStack
peek, peek, peekAt
-
Methods inherited from interface org.eclipse.collections.api.stack.primitive.MutableBooleanStack
collectWithIndex, rejectWithIndex, selectWithIndex, tap
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedBooleanIterable
collectWithIndex, forEachWithIndex, getFirst, indexOf, injectIntoWithIndex, rejectWithIndex, selectWithIndex
-
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
-
delegate
private transient BooleanArrayList delegate
-
-
Method Detail
-
newStackFromTopToBottom
public static BooleanArrayStack newStackFromTopToBottom(boolean... items)
-
newStackWith
public static BooleanArrayStack newStackWith(boolean... items)
-
newStack
public static BooleanArrayStack newStack(BooleanIterable items)
-
newStackFromTopToBottom
public static BooleanArrayStack newStackFromTopToBottom(BooleanIterable items)
-
getDelegate
protected BooleanArrayList getDelegate()
- Specified by:
getDelegate
in classAbstractBooleanStack
-
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
public BooleanList pop(int count)
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
public MutableBooleanStack 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 interfaceBooleanStack
- Specified by:
select
in interfaceMutableBooleanStack
- Specified by:
select
in interfaceOrderedBooleanIterable
-
reject
public MutableBooleanStack 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 interfaceBooleanStack
- Specified by:
reject
in interfaceMutableBooleanStack
- Specified by:
reject
in interfaceOrderedBooleanIterable
-
collect
public <V> MutableStack<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 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
public MutableBooleanStack asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableBooleanStack
-
asSynchronized
public MutableBooleanStack asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableBooleanStack
-
toImmutable
public ImmutableBooleanStack toImmutable()
- Specified by:
toImmutable
in interfaceBooleanStack
-
newEmpty
public BooleanArrayStack newEmpty()
Creates a new empty BooleanArrayStack.- Specified by:
newEmpty
in interfaceMutableBooleanStack
- Since:
- 9.2.
-
equals
public boolean equals(java.lang.Object otherStack)
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
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
- Specified by:
writeExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException
- Specified by:
readExternal
in interfacejava.io.Externalizable
- Throws:
java.io.IOException
-
-