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:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateBooleanArrayStack(boolean... items) privateBooleanArrayStack(int size) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()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.booleanFollows the same general contract asStackIterable.equals(Object).protected BooleanArrayListinthashCode()Follows the same general contract asStackIterable.hashCode().newEmpty()Creates a new empty BooleanArrayStack.static BooleanArrayStacknewStack(BooleanIterable items) static BooleanArrayStacknewStackFromTopToBottom(boolean... items) static BooleanArrayStackstatic BooleanArrayStacknewStackWith(boolean... items) booleanpop()Removes and returns the top element of the stack.pop(int count) Removes and returns a BooleanList of the number of elements specified by the count, beginning with the top of the stack.voidpush(boolean item) Adds an item to the top of the stack.voidreject(BooleanPredicate predicate) Returns a new BooleanIterable with all of the elements in the BooleanIterable that return false for the specified predicate.select(BooleanPredicate predicate) Returns a new BooleanIterable with all of the elements in the BooleanIterable that return true for the specified predicate.toStack()Converts the collection to a BooleanStack.voidMethods inherited from class 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, toStringMethods inherited from interface 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, toSetMethods inherited from interface BooleanStack
peek, peek, peekAtMethods inherited from interface MutableBooleanStack
collectWithIndex, rejectWithIndex, selectWithIndex, tapMethods inherited from interface OrderedBooleanIterable
collectWithIndex, forEachWithIndex, getFirst, indexOf, injectIntoWithIndex, rejectWithIndex, selectWithIndexMethods inherited from interface PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
delegate
-
-
Constructor Details
-
BooleanArrayStack
public BooleanArrayStack() -
BooleanArrayStack
private BooleanArrayStack(int size) -
BooleanArrayStack
private BooleanArrayStack(boolean... items)
-
-
Method Details
-
newStackFromTopToBottom
-
newStackWith
-
newStack
-
newStackFromTopToBottom
-
getDelegate
- Specified by:
getDelegatein classAbstractBooleanStack
-
push
public void push(boolean item) Description copied from interface:MutableBooleanStackAdds an item to the top of the stack.- Specified by:
pushin interfaceMutableBooleanStack
-
pop
public boolean pop()Description copied from interface:MutableBooleanStackRemoves and returns the top element of the stack.- Specified by:
popin interfaceMutableBooleanStack
-
pop
Description copied from interface:MutableBooleanStackRemoves and returns a BooleanList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
popin interfaceMutableBooleanStack
-
select
Description copied from interface:BooleanIterableReturns a new BooleanIterable with all of the elements in the BooleanIterable that return true for the specified predicate.- Specified by:
selectin interfaceBooleanIterable- Specified by:
selectin interfaceBooleanStack- Specified by:
selectin interfaceMutableBooleanStack- Specified by:
selectin interfaceOrderedBooleanIterable
-
reject
Description copied from interface:BooleanIterableReturns a new BooleanIterable with all of the elements in the BooleanIterable that return false for the specified predicate.- Specified by:
rejectin interfaceBooleanIterable- Specified by:
rejectin interfaceBooleanStack- Specified by:
rejectin interfaceMutableBooleanStack- Specified by:
rejectin interfaceOrderedBooleanIterable
-
collect
Description copied from interface:BooleanIterableReturns 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:
collectin interfaceBooleanIterable- Specified by:
collectin interfaceBooleanStack- Specified by:
collectin interfaceMutableBooleanStack- Specified by:
collectin interfaceOrderedBooleanIterable
-
clear
public void clear()Description copied from interface:MutableBooleanStackClears the Stack- Specified by:
clearin interfaceMutableBooleanStack
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableBooleanStack
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableBooleanStack
-
toImmutable
- Specified by:
toImmutablein interfaceBooleanStack
-
newEmpty
Creates a new empty BooleanArrayStack.- Specified by:
newEmptyin interfaceMutableBooleanStack- Since:
- 9.2.
-
equals
Description copied from interface:BooleanStackFollows the same general contract asStackIterable.equals(Object).- Specified by:
equalsin interfaceBooleanStack- Overrides:
equalsin classAbstractBooleanStack
-
hashCode
public int hashCode()Description copied from interface:BooleanStackFollows the same general contract asStackIterable.hashCode().- Specified by:
hashCodein interfaceBooleanStack- Overrides:
hashCodein classAbstractBooleanStack
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
toStack
Description copied from interface:OrderedBooleanIterableConverts the collection to a BooleanStack.- Specified by:
toStackin interfaceOrderedBooleanIterable
-