Package it.unimi.dsi.fastutil.shorts
Interface ShortStack
- All Known Implementing Classes:
AbstractShortBigList
,AbstractShortBigList.ShortRandomAccessSubList
,AbstractShortBigList.ShortSubList
,AbstractShortList
,AbstractShortList.ShortRandomAccessSubList
,AbstractShortList.ShortSubList
,AbstractShortStack
,ShortArrayList
,ShortBigArrayBigList
,ShortBigLists.ListBigList
,ShortBigLists.Singleton
,ShortImmutableList
,ShortLists.Singleton
,ShortMappedBigList
A type-specific
Stack
; provides some additional methods that use polymorphism to avoid
(un)boxing.-
Method Summary
Modifier and TypeMethodDescriptiondefault Short
peek
(int i) Deprecated.Please use the corresponding type-specific method instead.short
peekShort
(int i) Peeks at an element on the stack (optional operation).default Short
pop()
Deprecated.Please use the corresponding type-specific method instead.short
popShort()
Pops the top off the stack.void
push
(short k) Pushes the given object on the stack.default void
Deprecated.Please use the corresponding type-specific method instead.default Short
top()
Deprecated.Please use the corresponding type-specific method instead.short
topShort()
Peeks at the top of the stack (optional operation).
-
Method Details
-
push
void push(short k) Pushes the given object on the stack.- Parameters:
k
- the object to push on the stack.- See Also:
-
popShort
short popShort()Pops the top off the stack.- Returns:
- the top of the stack.
- See Also:
-
topShort
short topShort()Peeks at the top of the stack (optional operation).- Returns:
- the top of the stack.
- See Also:
-
peekShort
short peekShort(int i) Peeks at an element on the stack (optional operation).- Parameters:
i
- an index from the stop of the stack (0 represents the top).- Returns:
- the
i
-th element on the stack. - See Also:
-
push
Deprecated.Please use the corresponding type-specific method instead.Pushes the given object on the stack.This default implementation delegates to the corresponding type-specific method.
-
pop
Deprecated.Please use the corresponding type-specific method instead.Pops the top off the stack.This default implementation delegates to the corresponding type-specific method.
-
top
Deprecated.Please use the corresponding type-specific method instead.Peeks at the top of the stack (optional operation).This default implementation returns
peek(0)
.This default implementation delegates to the corresponding type-specific method.
-
peek
Deprecated.Please use the corresponding type-specific method instead.Peeks at an element on the stack (optional operation).This default implementation just throws an
UnsupportedOperationException
.This default implementation delegates to the corresponding type-specific method.
-