Top Description Fields Constructors Methods
org.eclipse.collections.impl.stack.mutable.primitive

public Class LongArrayStack

extends AbstractLongStack
implements MutableLongStack, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, org.eclipse.collections.api.stack.primitive.MutableLongStack, org.eclipse.collections.api.stack.primitive.LongStack, org.eclipse.collections.api.ordered.primitive.OrderedLongIterable, org.eclipse.collections.api.LongIterable, org.eclipse.collections.api.PrimitiveIterable
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, org.eclipse.collections.api.LongIterable, org.eclipse.collections.api.block.function.primitive.LongToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.LongPredicate, org.eclipse.collections.api.iterator.LongIterator, org.eclipse.collections.api.list.primitive.LongList, .MutableLongList, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.stack.primitive.LongStack, .ImmutableLongStack, .MutableLongStack, org.eclipse.collections.impl.factory.primitive.LongStacks, org.eclipse.collections.impl.list.mutable.primitive.LongArrayList, org.eclipse.collections.impl.stack.primitive.AbstractLongStack, org.eclipse.collections.impl.stack.mutable.ArrayStack

LongArrayStack is similar to ArrayStack, and is memory-optimized for long primitives. This file was automatically generated from template file primitiveArrayStack.stg.

Field Summary

Modifier and TypeField and Description
private transient LongArrayList
private static final long

Constructor Summary

AccessConstructor and Description
public
private
LongArrayStack(int size)

private
LongArrayStack(long... items)

Method Summary

Modifier and TypeMethod and Description
public MutableLongStack
public MutableLongStack
public void
public <V> MutableStack<V>
collect(LongToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.collect, org.eclipse.collections.api.stack.primitive.LongStack.collect.

Returns a new collection with the results of applying the specified function on each element of the source collection.

public boolean
protected LongArrayList
public int
public LongArrayStack
newEmpty()

Overrides default org.eclipse.collections.api.stack.primitive.MutableLongStack.newEmpty.

Creates a new empty LongArrayStack.

public static LongArrayStack
public static LongArrayStack
newStackFromTopToBottom(long... items)

public static LongArrayStack
public static LongArrayStack
newStackWith(long... items)

public long
pop()

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.pop.

Removes and returns the top element of the stack.

public LongList
pop(int count)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.pop.

Removes and returns a LongList of the number of elements specified by the count, beginning with the top of the stack.

public void
push(long item)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.push.

Adds an item to the top of the stack.

public void
readExternal(ObjectInput in)

Implements java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays.

public MutableLongStack
reject(LongPredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.reject, org.eclipse.collections.api.stack.primitive.LongStack.reject.

Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.

public MutableLongStack
select(LongPredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.select, org.eclipse.collections.api.stack.primitive.LongStack.select.

Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.

public ImmutableLongStack
public MutableLongList
public MutableLongStack
toStack()

Overrides default org.eclipse.collections.api.ordered.primitive.OrderedLongIterable.toStack.

Converts the collection to a LongStack.

public void
writeExternal(ObjectOutput out)

Implements java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Inherited from org.eclipse.collections.impl.stack.primitive.AbstractLongStack:
allSatisfyanySatisfyappendStringappendStringappendStringasLazyaveragecheckEmptyStackcheckPositiveValueForCountcheckSizeLessThanCountchunkcontainscontainsAllcontainsAllcountdetectIfNoneeachforEachWithIndexgetFirstindexOfinjectIntoinjectIntoWithIndexlongIteratormakeStringmakeStringmakeStringmaxmaxIfEmptymedianminminIfEmptynoneSatisfypeekpeekpeekAtrangeChecksizesumtoArraytoArraytoBagtoListtoSettoSortedArraytoString

Field Detail

delegateback to summary
private transient LongArrayList delegate
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

LongArrayStackback to summary
public LongArrayStack()
LongArrayStackback to summary
private LongArrayStack(int size)
LongArrayStackback to summary
private LongArrayStack(long... items)

Method Detail

asSynchronizedback to summary
public MutableLongStack asSynchronized()

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.asSynchronized.

Annotations
@Override
asUnmodifiableback to summary
public MutableLongStack asUnmodifiable()

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.asUnmodifiable.

Annotations
@Override
clearback to summary
public void clear()

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.clear.

Doc from org.eclipse.collections.api.stack.primitive.MutableLongStack.clear.

Clears the Stack

Annotations
@Override
collectback to summary
public <V> MutableStack<V> collect(LongToObjectFunction<? extends V> function)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.collect, org.eclipse.collections.api.stack.primitive.LongStack.collect.

Doc from org.eclipse.collections.api.LongIterable.collect.

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.

Annotations
@Override
equalsback to summary
public boolean equals(Object otherStack)

Overrides org.eclipse.collections.impl.stack.primitive.AbstractLongStack.equals.

Implements org.eclipse.collections.api.stack.primitive.LongStack.equals.

Doc from org.eclipse.collections.api.stack.primitive.LongStack.equals.

Follows the same general contract as StackIterable#equals(Object).

Annotations
@Override
getDelegateback to summary
protected LongArrayList getDelegate()

Implements abstract org.eclipse.collections.impl.stack.primitive.AbstractLongStack.getDelegate.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides org.eclipse.collections.impl.stack.primitive.AbstractLongStack.hashCode.

Implements org.eclipse.collections.api.stack.primitive.LongStack.hashCode.

Doc from org.eclipse.collections.api.stack.primitive.LongStack.hashCode.

Follows the same general contract as StackIterable#hashCode().

Annotations
@Override
newEmptyback to summary
public LongArrayStack newEmpty()

Overrides default org.eclipse.collections.api.stack.primitive.MutableLongStack.newEmpty.

Creates a new empty LongArrayStack.

Annotations
@Override
Since
9.2.
newStackback to summary
public static LongArrayStack newStack(LongIterable items)
newStackFromTopToBottomback to summary
public static LongArrayStack newStackFromTopToBottom(long... items)
newStackFromTopToBottomback to summary
public static LongArrayStack newStackFromTopToBottom(LongIterable items)
newStackWithback to summary
public static LongArrayStack newStackWith(long... items)
popback to summary
public long pop()

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.pop.

Doc from org.eclipse.collections.api.stack.primitive.MutableLongStack.pop.

Removes and returns the top element of the stack.

Annotations
@Override
popback to summary
public LongList pop(int count)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.pop.

Doc from org.eclipse.collections.api.stack.primitive.MutableLongStack.pop.

Removes and returns a LongList of the number of elements specified by the count, beginning with the top of the stack.

Annotations
@Override
pushback to summary
public void push(long item)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.push.

Doc from org.eclipse.collections.api.stack.primitive.MutableLongStack.push.

Adds an item to the top of the stack.

Annotations
@Override
readExternalback to summary
public void readExternal(ObjectInput in) throws IOException

Implements java.io.Externalizable.readExternal.

Doc from java.io.Externalizable.readExternal.

The object implements the readExternal method to restore its contents by calling the methods of DataInput for primitive types and readObject for objects, strings and arrays. The readExternal method must read the values in the same sequence and with the same types as were written by writeExternal.

Annotations
@Override
Exceptions
IOException:
if I/O errors occur
rejectback to summary
public MutableLongStack reject(LongPredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.reject, org.eclipse.collections.api.stack.primitive.LongStack.reject.

Doc from org.eclipse.collections.api.LongIterable.reject.

Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.

Annotations
@Override
selectback to summary
public MutableLongStack select(LongPredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableLongStack.select, org.eclipse.collections.api.stack.primitive.LongStack.select.

Doc from org.eclipse.collections.api.LongIterable.select.

Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.

Annotations
@Override
toImmutableback to summary
public ImmutableLongStack toImmutable()

Implements org.eclipse.collections.api.stack.primitive.LongStack.toImmutable.

Annotations
@Override
toSortedListback to summary
public MutableLongList toSortedList()

Implements org.eclipse.collections.api.LongIterable.toSortedList.

Annotations
@Override
toStackback to summary
public MutableLongStack toStack()

Overrides default org.eclipse.collections.api.ordered.primitive.OrderedLongIterable.toStack.

Doc from org.eclipse.collections.api.ordered.primitive.OrderedLongIterable.toStack.

Converts the collection to a LongStack.

Annotations
@Override
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Doc from java.io.Externalizable.writeExternal.

The object implements the writeExternal method to save its contents by calling the methods of DataOutput for its primitive values or calling the writeObject method of ObjectOutput for objects, strings, and arrays.

Annotations
@Override
Exceptions
IOException:
Includes any I/O exceptions that may occur