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 BooleanArrayListdelegateprivate static longserialVersionUID
-
Constructor Summary
Constructors Modifier Constructor Description BooleanArrayStack()privateBooleanArrayStack(boolean... items)privateBooleanArrayStack(int size)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MutableBooleanStackasSynchronized()MutableBooleanStackasUnmodifiable()voidclear()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.booleanequals(java.lang.Object otherStack)Follows the same general contract asStackIterable.equals(Object).protected BooleanArrayListgetDelegate()inthashCode()Follows the same general contract asStackIterable.hashCode().BooleanArrayStacknewEmpty()Creates a new empty BooleanArrayStack.static BooleanArrayStacknewStack(BooleanIterable items)static BooleanArrayStacknewStackFromTopToBottom(boolean... items)static BooleanArrayStacknewStackFromTopToBottom(BooleanIterable items)static BooleanArrayStacknewStackWith(boolean... items)booleanpop()Removes and returns the top element of the stack.BooleanListpop(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.voidreadExternal(java.io.ObjectInput in)MutableBooleanStackreject(BooleanPredicate predicate)Returns a new BooleanIterable with all of the elements in the BooleanIterable that return false for the specified predicate.MutableBooleanStackselect(BooleanPredicate predicate)Returns a new BooleanIterable with all of the elements in the BooleanIterable that return true for the specified predicate.ImmutableBooleanStacktoImmutable()MutableBooleanStacktoStack()Converts the collection to a BooleanStack.voidwriteExternal(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:
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
public BooleanList pop(int count)
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
public MutableBooleanStack select(BooleanPredicate predicate)
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
public MutableBooleanStack reject(BooleanPredicate predicate)
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
public <V> MutableStack<V> collect(BooleanToObjectFunction<? extends V> function)
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
public MutableBooleanStack asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableBooleanStack
-
asSynchronized
public MutableBooleanStack asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableBooleanStack
-
toImmutable
public ImmutableBooleanStack toImmutable()
- Specified by:
toImmutablein interfaceBooleanStack
-
newEmpty
public BooleanArrayStack newEmpty()
Creates a new empty BooleanArrayStack.- Specified by:
newEmptyin interfaceMutableBooleanStack- Since:
- 9.2.
-
equals
public boolean equals(java.lang.Object otherStack)
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
public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException- Specified by:
writeExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
readExternal
public void readExternal(java.io.ObjectInput in) throws java.io.IOException- Specified by:
readExternalin interfacejava.io.Externalizable- Throws:
java.io.IOException
-
toStack
public MutableBooleanStack toStack()
Description copied from interface:OrderedBooleanIterableConverts the collection to a BooleanStack.- Specified by:
toStackin interfaceOrderedBooleanIterable
-
-