Class IntArrayStack
java.lang.Object
org.eclipse.collections.impl.stack.primitive.AbstractIntStack
org.eclipse.collections.impl.stack.mutable.primitive.IntArrayStack
- All Implemented Interfaces:
Externalizable,Serializable,IntIterable,OrderedIntIterable,PrimitiveIterable,IntStack,MutableIntStack
IntArrayStack is similar to
ArrayStack, and is memory-optimized for int primitives.
This file was automatically generated from template file primitiveArrayStack.stg.- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears the Stack<V> MutableStack<V>collect(IntToObjectFunction<? 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).inthashCode()Follows the same general contract asStackIterable.hashCode().newEmpty()Creates a new empty IntArrayStack.static IntArrayStacknewStack(IntIterable items) static IntArrayStacknewStackFromTopToBottom(int... items) static IntArrayStackstatic IntArrayStacknewStackWith(int... items) intpop()Removes and returns the top element of the stack.pop(int count) Removes and returns a IntList of the number of elements specified by the count, beginning with the top of the stack.voidpush(int item) Adds an item to the top of the stack.voidreject(IntPredicate predicate) Returns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.select(IntPredicate predicate) Returns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.voidMethods inherited from class org.eclipse.collections.impl.stack.primitive.AbstractIntStack
allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, chunk, contains, containsAll, containsAll, count, detectIfNone, each, forEach, forEachWithIndex, getFirst, indexOf, injectInto, injectIntoWithIndex, intIterator, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, peek, peek, peekAt, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toStringMethods inherited from interface org.eclipse.collections.api.IntIterable
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, intIterator, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedListBy, toSortedListByMethods inherited from interface org.eclipse.collections.api.stack.primitive.IntStack
peek, peek, peekAtMethods inherited from interface org.eclipse.collections.api.stack.primitive.MutableIntStack
collectWithIndex, tapMethods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedIntIterable
collectWithIndex, forEachWithIndex, getFirst, indexOf, injectIntoWithIndexMethods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Constructor Details
-
IntArrayStack
public IntArrayStack()
-
-
Method Details
-
newStackFromTopToBottom
-
newStackWith
-
newStack
-
newStackFromTopToBottom
-
push
public void push(int item) Description copied from interface:MutableIntStackAdds an item to the top of the stack.- Specified by:
pushin interfaceMutableIntStack
-
pop
public int pop()Description copied from interface:MutableIntStackRemoves and returns the top element of the stack.- Specified by:
popin interfaceMutableIntStack
-
pop
Description copied from interface:MutableIntStackRemoves and returns a IntList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
popin interfaceMutableIntStack
-
select
Description copied from interface:IntIterableReturns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.- Specified by:
selectin interfaceIntIterable- Specified by:
selectin interfaceIntStack- Specified by:
selectin interfaceMutableIntStack- Specified by:
selectin interfaceOrderedIntIterable
-
reject
Description copied from interface:IntIterableReturns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.- Specified by:
rejectin interfaceIntIterable- Specified by:
rejectin interfaceIntStack- Specified by:
rejectin interfaceMutableIntStack- Specified by:
rejectin interfaceOrderedIntIterable
-
collect
Description copied from interface:IntIterableReturns 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 interfaceIntIterable- Specified by:
collectin interfaceIntStack- Specified by:
collectin interfaceMutableIntStack- Specified by:
collectin interfaceOrderedIntIterable
-
clear
public void clear()Description copied from interface:MutableIntStackClears the Stack- Specified by:
clearin interfaceMutableIntStack
-
toSortedList
- Specified by:
toSortedListin interfaceIntIterable
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableIntStack
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableIntStack
-
toImmutable
- Specified by:
toImmutablein interfaceIntStack
-
newEmpty
Creates a new empty IntArrayStack.- Specified by:
newEmptyin interfaceMutableIntStack- Since:
- 9.2.
-
equals
Description copied from interface:IntStackFollows the same general contract asStackIterable.equals(Object).- Specified by:
equalsin interfaceIntStack- Overrides:
equalsin classAbstractIntStack
-
hashCode
public int hashCode()Description copied from interface:IntStackFollows the same general contract asStackIterable.hashCode().- Specified by:
hashCodein interfaceIntStack- Overrides:
hashCodein classAbstractIntStack
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-