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 toArrayStack
, 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MutableIntStack
asSynchronized()
MutableIntStack
asUnmodifiable()
void
clear()
<V> MutableStack<V>
collect(IntToObjectFunction<? extends V> function)
boolean
equals(Object otherStack)
int
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()
IntList
pop(int count)
void
push(int item)
void
readExternal(ObjectInput in)
MutableIntStack
reject(IntPredicate predicate)
MutableIntStack
select(IntPredicate 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, 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, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, intIterator, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedListBy, toSortedListBy
-
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, rejectWithIndex, selectWithIndex, tap
-
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedIntIterable
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
-
-
-
-
Method Detail
-
newStackFromTopToBottom
public static IntArrayStack newStackFromTopToBottom(int... items)
-
newStackWith
public static IntArrayStack newStackWith(int... items)
-
newStack
public static IntArrayStack newStack(IntIterable items)
-
newStackFromTopToBottom
public static IntArrayStack newStackFromTopToBottom(IntIterable items)
-
push
public void push(int item)
- Specified by:
push
in interfaceMutableIntStack
-
pop
public int pop()
- Specified by:
pop
in interfaceMutableIntStack
-
pop
public IntList pop(int count)
- Specified by:
pop
in interfaceMutableIntStack
-
select
public MutableIntStack select(IntPredicate predicate)
- Specified by:
select
in interfaceIntIterable
- Specified by:
select
in interfaceIntStack
- Specified by:
select
in interfaceMutableIntStack
- Specified by:
select
in interfaceOrderedIntIterable
-
reject
public MutableIntStack reject(IntPredicate predicate)
- Specified by:
reject
in interfaceIntIterable
- Specified by:
reject
in interfaceIntStack
- Specified by:
reject
in interfaceMutableIntStack
- Specified by:
reject
in interfaceOrderedIntIterable
-
collect
public <V> MutableStack<V> collect(IntToObjectFunction<? extends V> function)
- Specified by:
collect
in interfaceIntIterable
- Specified by:
collect
in interfaceIntStack
- Specified by:
collect
in interfaceMutableIntStack
- Specified by:
collect
in interfaceOrderedIntIterable
-
clear
public void clear()
- Specified by:
clear
in interfaceMutableIntStack
-
toSortedList
public MutableIntList toSortedList()
- Specified by:
toSortedList
in interfaceIntIterable
-
asUnmodifiable
public MutableIntStack asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableIntStack
-
asSynchronized
public MutableIntStack asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableIntStack
-
toImmutable
public ImmutableIntStack toImmutable()
- Specified by:
toImmutable
in interfaceIntStack
-
newEmpty
public IntArrayStack newEmpty()
Creates a new empty IntArrayStack.- Specified by:
newEmpty
in interfaceMutableIntStack
- Since:
- 9.2.
-
equals
public boolean equals(Object otherStack)
- Specified by:
equals
in interfaceIntStack
- Overrides:
equals
in classAbstractIntStack
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceIntStack
- Overrides:
hashCode
in classAbstractIntStack
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-
-