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

public Class ShortArrayStack

extends AbstractShortStack
implements MutableShortStack, Externalizable
Class Inheritance
All Implemented Interfaces
java.io.Externalizable, java.io.Serializable, org.eclipse.collections.api.stack.primitive.MutableShortStack, org.eclipse.collections.api.stack.primitive.ShortStack, org.eclipse.collections.api.ordered.primitive.OrderedShortIterable, org.eclipse.collections.api.ShortIterable, org.eclipse.collections.api.PrimitiveIterable
Imports
java.io.Externalizable, .IOException, .ObjectInput, .ObjectOutput, org.eclipse.collections.api.ShortIterable, org.eclipse.collections.api.block.function.primitive.ShortToObjectFunction, org.eclipse.collections.api.block.predicate.primitive.ShortPredicate, org.eclipse.collections.api.iterator.ShortIterator, org.eclipse.collections.api.list.primitive.ShortList, .MutableShortList, org.eclipse.collections.api.stack.MutableStack, org.eclipse.collections.api.stack.primitive.ShortStack, .ImmutableShortStack, .MutableShortStack, org.eclipse.collections.impl.factory.primitive.ShortStacks, org.eclipse.collections.impl.list.mutable.primitive.ShortArrayList, org.eclipse.collections.impl.stack.primitive.AbstractShortStack, org.eclipse.collections.impl.stack.mutable.ArrayStack

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
private
ShortArrayStack(int size)

private
ShortArrayStack(short... items)

Method Summary

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

Implements org.eclipse.collections.api.stack.primitive.MutableShortStack.collect, org.eclipse.collections.api.stack.primitive.ShortStack.collect.

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

public boolean
protected ShortArrayList
public int
public ShortArrayStack
newEmpty()

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

Creates a new empty ShortArrayStack.

public static ShortArrayStack
public static ShortArrayStack
newStackFromTopToBottom(short... items)

public static ShortArrayStack
public static ShortArrayStack
newStackWith(short... items)

public short
pop()

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

Removes and returns the top element of the stack.

public ShortList
pop(int count)

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

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

public void
push(short item)

Implements org.eclipse.collections.api.stack.primitive.MutableShortStack.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 MutableShortStack
reject(ShortPredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableShortStack.reject, org.eclipse.collections.api.stack.primitive.ShortStack.reject.

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

public MutableShortStack
select(ShortPredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableShortStack.select, org.eclipse.collections.api.stack.primitive.ShortStack.select.

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

public ImmutableShortStack
public MutableShortList
public MutableShortStack
toStack()

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

Converts the collection to a ShortStack.

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.AbstractShortStack:
allSatisfyanySatisfyappendStringappendStringappendStringasLazyaveragecheckEmptyStackcheckPositiveValueForCountcheckSizeLessThanCountchunkcontainscontainsAllcontainsAllcountdetectIfNoneeachforEachWithIndexgetFirstindexOfinjectIntoinjectIntoWithIndexmakeStringmakeStringmakeStringmaxmaxIfEmptymedianminminIfEmptynoneSatisfypeekpeekpeekAtrangeCheckshortIteratorsizesumtoArraytoArraytoBagtoListtoSettoSortedArraytoString

Field Detail

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

Constructor Detail

ShortArrayStackback to summary
public ShortArrayStack()
ShortArrayStackback to summary
private ShortArrayStack(int size)
ShortArrayStackback to summary
private ShortArrayStack(short... items)

Method Detail

asSynchronizedback to summary
public MutableShortStack asSynchronized()

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

Annotations
@Override
asUnmodifiableback to summary
public MutableShortStack asUnmodifiable()

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

Annotations
@Override
clearback to summary
public void clear()

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

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

Clears the Stack

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

Implements org.eclipse.collections.api.stack.primitive.MutableShortStack.collect, org.eclipse.collections.api.stack.primitive.ShortStack.collect.

Doc from org.eclipse.collections.api.ShortIterable.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.AbstractShortStack.equals.

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

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

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

Annotations
@Override
getDelegateback to summary
protected ShortArrayList getDelegate()

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

Annotations
@Override
hashCodeback to summary
public int hashCode()

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

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

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

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

Annotations
@Override
newEmptyback to summary
public ShortArrayStack newEmpty()

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

Creates a new empty ShortArrayStack.

Annotations
@Override
Since
9.2.
newStackback to summary
public static ShortArrayStack newStack(ShortIterable items)
newStackFromTopToBottomback to summary
public static ShortArrayStack newStackFromTopToBottom(short... items)
newStackFromTopToBottomback to summary
public static ShortArrayStack newStackFromTopToBottom(ShortIterable items)
newStackWithback to summary
public static ShortArrayStack newStackWith(short... items)
popback to summary
public short pop()

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

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

Removes and returns the top element of the stack.

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

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

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

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

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

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

Doc from org.eclipse.collections.api.stack.primitive.MutableShortStack.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 MutableShortStack reject(ShortPredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableShortStack.reject, org.eclipse.collections.api.stack.primitive.ShortStack.reject.

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

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

Annotations
@Override
selectback to summary
public MutableShortStack select(ShortPredicate predicate)

Implements org.eclipse.collections.api.stack.primitive.MutableShortStack.select, org.eclipse.collections.api.stack.primitive.ShortStack.select.

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

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

Annotations
@Override
toImmutableback to summary
public ImmutableShortStack toImmutable()

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

Annotations
@Override
toSortedListback to summary
public MutableShortList toSortedList()

Implements org.eclipse.collections.api.ShortIterable.toSortedList.

Annotations
@Override
toStackback to summary
public MutableShortStack toStack()

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

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

Converts the collection to a ShortStack.

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