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
public class IntArrayStack extends AbstractIntStack implements MutableIntStack, Externalizable
IntArrayStack is similar to
ArrayStack
, and is memory-optimized for int primitives.
This file was automatically generated from template file primitiveArrayStack.stg.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description IntArrayStack()
-
Method Summary
Modifier and Type Method Description MutableIntStack
asSynchronized()
MutableIntStack
asUnmodifiable()
void
clear()
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.boolean
equals(Object otherStack)
Follows the same general contract asStackIterable.equals(Object)
.int
hashCode()
Follows the same general contract asStackIterable.hashCode()
.IntArrayStack
newEmpty()
Creates a new empty IntArrayStack.static IntArrayStack
newStack(IntIterable items)
static IntArrayStack
newStackFromTopToBottom(int... items)
static IntArrayStack
newStackFromTopToBottom(IntIterable items)
static IntArrayStack
newStackWith(int... items)
int
pop()
Removes and returns the top element of the stack.IntList
pop(int count)
Removes and returns a IntList of the number of elements specified by the count, beginning with the top of the stack.void
push(int item)
Adds an item to the top of the stack.void
readExternal(ObjectInput in)
MutableIntStack
reject(IntPredicate predicate)
Returns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.MutableIntStack
select(IntPredicate predicate)
Returns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.ImmutableIntStack
toImmutable()
MutableIntList
toSortedList()
void
writeExternal(ObjectOutput out)
Methods 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, toString
Methods 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, 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
Methods inherited from interface org.eclipse.collections.api.stack.primitive.IntStack
peek, peek, peekAt
Methods inherited from interface org.eclipse.collections.api.stack.primitive.MutableIntStack
collectWithIndex, tap
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedIntIterable
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
-
IntArrayStack
public IntArrayStack()
-
-
Method Details
-
newStackFromTopToBottom
-
newStackWith
-
newStack
-
newStackFromTopToBottom
-
push
public void push(int item)Description copied from interface:MutableIntStack
Adds an item to the top of the stack.- Specified by:
push
in interfaceMutableIntStack
-
pop
public int pop()Description copied from interface:MutableIntStack
Removes and returns the top element of the stack.- Specified by:
pop
in interfaceMutableIntStack
-
pop
Description copied from interface:MutableIntStack
Removes and returns a IntList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
pop
in interfaceMutableIntStack
-
select
Description copied from interface:IntIterable
Returns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.- Specified by:
select
in interfaceIntIterable
- Specified by:
select
in interfaceIntStack
- Specified by:
select
in interfaceMutableIntStack
- Specified by:
select
in interfaceOrderedIntIterable
-
reject
Description copied from interface:IntIterable
Returns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.- Specified by:
reject
in interfaceIntIterable
- Specified by:
reject
in interfaceIntStack
- Specified by:
reject
in interfaceMutableIntStack
- Specified by:
reject
in interfaceOrderedIntIterable
-
collect
Description copied from interface:IntIterable
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 interfaceIntIterable
- Specified by:
collect
in interfaceIntStack
- Specified by:
collect
in interfaceMutableIntStack
- Specified by:
collect
in interfaceOrderedIntIterable
-
clear
public void clear()Description copied from interface:MutableIntStack
Clears the Stack- Specified by:
clear
in interfaceMutableIntStack
-
toSortedList
- Specified by:
toSortedList
in interfaceIntIterable
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableIntStack
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableIntStack
-
toImmutable
- Specified by:
toImmutable
in interfaceIntStack
-
newEmpty
Creates a new empty IntArrayStack.- Specified by:
newEmpty
in interfaceMutableIntStack
- Since:
- 9.2.
-
equals
Description copied from interface:IntStack
Follows the same general contract asStackIterable.equals(Object)
.- Specified by:
equals
in interfaceIntStack
- Overrides:
equals
in classAbstractIntStack
-
hashCode
public int hashCode()Description copied from interface:IntStack
Follows the same general contract asStackIterable.hashCode()
.- Specified by:
hashCode
in interfaceIntStack
- Overrides:
hashCode
in classAbstractIntStack
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-