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
LongArrayStack is similar to
ArrayStack, and is memory-optimized for long primitives.
This file was automatically generated from template file primitiveArrayStack.stg.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateLongArrayStack(int size) privateLongArrayStack(long... items) -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()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.booleanFollows the same general contract asStackIterable.equals(Object).protected LongArrayListinthashCode()Follows the same general contract asStackIterable.hashCode().newEmpty()Creates a new empty LongArrayStack.static LongArrayStacknewStack(LongIterable items) static LongArrayStacknewStackFromTopToBottom(long... items) static LongArrayStackstatic LongArrayStacknewStackWith(long... items) longpop()Removes and returns the top element of the stack.pop(int count) Removes and returns a LongList of the number of elements specified by the count, beginning with the top of the stack.voidpush(long item) Adds an item to the top of the stack.voidreject(LongPredicate predicate) Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.select(LongPredicate predicate) Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.toStack()Converts the collection to a LongStack.voidMethods inherited from class AbstractLongStack
allSatisfy, anySatisfy, appendString, appendString, appendString, asLazy, average, checkEmptyStack, checkPositiveValueForCount, checkSizeLessThanCount, chunk, contains, containsAll, containsAll, count, detectIfNone, each, forEachWithIndex, getFirst, indexOf, injectInto, injectIntoWithIndex, longIterator, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, peek, peek, peekAt, rangeCheck, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toStringMethods inherited from interface LongIterable
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, longIterator, 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 MutableLongStack
collectWithIndex, rejectWithIndex, selectWithIndex, tapMethods inherited from interface OrderedLongIterable
collectWithIndex, forEachWithIndex, getFirst, indexOf, injectIntoWithIndex, rejectWithIndex, selectWithIndexMethods inherited from interface PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
delegate
-
-
Constructor Details
-
LongArrayStack
public LongArrayStack() -
LongArrayStack
private LongArrayStack(int size) -
LongArrayStack
private LongArrayStack(long... items)
-
-
Method Details
-
newStackFromTopToBottom
-
newStackWith
-
newStack
-
newStackFromTopToBottom
-
getDelegate
- Specified by:
getDelegatein classAbstractLongStack
-
push
public void push(long item) Description copied from interface:MutableLongStackAdds an item to the top of the stack.- Specified by:
pushin interfaceMutableLongStack
-
pop
public long pop()Description copied from interface:MutableLongStackRemoves and returns the top element of the stack.- Specified by:
popin interfaceMutableLongStack
-
pop
Description copied from interface:MutableLongStackRemoves and returns a LongList of the number of elements specified by the count, beginning with the top of the stack.- Specified by:
popin interfaceMutableLongStack
-
select
Description copied from interface:LongIterableReturns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.- Specified by:
selectin interfaceLongIterable- Specified by:
selectin interfaceLongStack- Specified by:
selectin interfaceMutableLongStack- Specified by:
selectin interfaceOrderedLongIterable
-
reject
Description copied from interface:LongIterableReturns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.- Specified by:
rejectin interfaceLongIterable- Specified by:
rejectin interfaceLongStack- Specified by:
rejectin interfaceMutableLongStack- Specified by:
rejectin interfaceOrderedLongIterable
-
collect
Description copied from interface:LongIterableReturns 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 interfaceLongIterable- Specified by:
collectin interfaceLongStack- Specified by:
collectin interfaceMutableLongStack- Specified by:
collectin interfaceOrderedLongIterable
-
clear
public void clear()Description copied from interface:MutableLongStackClears the Stack- Specified by:
clearin interfaceMutableLongStack
-
toSortedList
- Specified by:
toSortedListin interfaceLongIterable
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableLongStack
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableLongStack
-
toImmutable
- Specified by:
toImmutablein interfaceLongStack
-
newEmpty
Creates a new empty LongArrayStack.- Specified by:
newEmptyin interfaceMutableLongStack- Since:
- 9.2.
-
equals
Description copied from interface:LongStackFollows the same general contract asStackIterable.equals(Object).- Specified by:
equalsin interfaceLongStack- Overrides:
equalsin classAbstractLongStack
-
hashCode
public int hashCode()Description copied from interface:LongStackFollows the same general contract asStackIterable.hashCode().- Specified by:
hashCodein interfaceLongStack- Overrides:
hashCodein classAbstractLongStack
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
toStack
Description copied from interface:OrderedLongIterableConverts the collection to a LongStack.- Specified by:
toStackin interfaceOrderedLongIterable
-