Class LongArrayStack
java.lang.Object
org.eclipse.collections.impl.stack.primitive.AbstractLongStack
org.eclipse.collections.impl.stack.mutable.primitive.LongArrayStack
- All Implemented Interfaces:
Externalizable
,Serializable
,LongIterable
,OrderedLongIterable
,PrimitiveIterable
,LongStack
,MutableLongStack
public class LongArrayStack extends AbstractLongStack implements MutableLongStack, Externalizable
LongArrayStack is similar to
ArrayStack
, and is memory-optimized for long primitives.
This file was automatically generated from template file primitiveArrayStack.stg.- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description LongArrayStack()
-
Method Summary
Modifier and Type Method Description MutableLongStack
asSynchronized()
MutableLongStack
asUnmodifiable()
void
clear()
Clears the Stack<V> MutableStack<V>
collect(LongToObjectFunction<? 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()
.LongArrayStack
newEmpty()
Creates a new empty LongArrayStack.static LongArrayStack
newStack(LongIterable items)
static LongArrayStack
newStackFromTopToBottom(long... items)
static LongArrayStack
newStackFromTopToBottom(LongIterable items)
static LongArrayStack
newStackWith(long... items)
long
pop()
Removes and returns the top element of the stack.LongList
pop(int count)
Removes and returns a LongList of the number of elements specified by the count, beginning with the top of the stack.void
push(long item)
Adds an item to the top of the stack.void
readExternal(ObjectInput in)
MutableLongStack
reject(LongPredicate predicate)
Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.MutableLongStack
select(LongPredicate predicate)
Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.ImmutableLongStack
toImmutable()
MutableLongList
toSortedList()
void
writeExternal(ObjectOutput out)
Methods inherited from class org.eclipse.collections.impl.stack.primitive.AbstractLongStack
allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, chunk, contains, containsAll, containsAll, count, detectIfNone, each, forEach, forEachWithIndex, getFirst, indexOf, injectInto, injectIntoWithIndex, longIterator, 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.LongIterable
allSatisfy, anySatisfy, asLazy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, longIterator, 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.LongStack
peek, peek, peekAt
Methods inherited from interface org.eclipse.collections.api.stack.primitive.MutableLongStack
collectWithIndex, tap
Methods inherited from interface org.eclipse.collections.api.ordered.primitive.OrderedLongIterable
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
-
LongArrayStack
public LongArrayStack()
-
-
Method Details
-
newStackFromTopToBottom
-
newStackWith
-
newStack
-
newStackFromTopToBottom
-
push
public void push(long item)Description copied from interface:MutableLongStack
Adds an item to the top of the stack.- Specified by:
push
in interfaceMutableLongStack
-
pop
public long pop()Description copied from interface:MutableLongStack
Removes and returns the top element of the stack.- Specified by:
pop
in interfaceMutableLongStack
-
pop
Description copied from interface:MutableLongStack
Removes and returns a LongList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
pop
in interfaceMutableLongStack
-
select
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.- Specified by:
select
in interfaceLongIterable
- Specified by:
select
in interfaceLongStack
- Specified by:
select
in interfaceMutableLongStack
- Specified by:
select
in interfaceOrderedLongIterable
-
reject
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.- Specified by:
reject
in interfaceLongIterable
- Specified by:
reject
in interfaceLongStack
- Specified by:
reject
in interfaceMutableLongStack
- Specified by:
reject
in interfaceOrderedLongIterable
-
collect
Description copied from interface:LongIterable
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 interfaceLongIterable
- Specified by:
collect
in interfaceLongStack
- Specified by:
collect
in interfaceMutableLongStack
- Specified by:
collect
in interfaceOrderedLongIterable
-
clear
public void clear()Description copied from interface:MutableLongStack
Clears the Stack- Specified by:
clear
in interfaceMutableLongStack
-
toSortedList
- Specified by:
toSortedList
in interfaceLongIterable
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableLongStack
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableLongStack
-
toImmutable
- Specified by:
toImmutable
in interfaceLongStack
-
newEmpty
Creates a new empty LongArrayStack.- Specified by:
newEmpty
in interfaceMutableLongStack
- Since:
- 9.2.
-
equals
Description copied from interface:LongStack
Follows the same general contract asStackIterable.equals(Object)
.- Specified by:
equals
in interfaceLongStack
- Overrides:
equals
in classAbstractLongStack
-
hashCode
public int hashCode()Description copied from interface:LongStack
Follows the same general contract asStackIterable.hashCode()
.- Specified by:
hashCode
in interfaceLongStack
- Overrides:
hashCode
in classAbstractLongStack
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-