Documentation
¶
Index ¶
- func Collector[T any]() seq.Collector[*Stack[T], T, *Stack[T]]
- type Stack
- func (a *Stack[T]) AddLast(element T)
- func (a *Stack[T]) Capacity() int
- func (a *Stack[T]) Clear()
- func (a *Stack[T]) Clone() *Stack[T]
- func (a *Stack[T]) Count() int
- func (a *Stack[T]) Iterator() seq.Iterator[T]
- func (a *Stack[T]) Last() ref.Ref[T]
- func (a *Stack[T]) RemoveLast() option.Option[T]
- func (a *Stack[T]) Reserve(additional int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Stack ¶
type Stack[T any] struct { // contains filtered or unexported fields }
Stack implemented using Array.
func From ¶ added in v1.2.0
func From[T any](collection seq.Collection[T]) *Stack[T]
Constructing an Stack from other Collection.
func (*Stack[T]) AddLast ¶ added in v1.2.0
func (a *Stack[T]) AddLast(element T)
Add an element to the top of the stack.
func (*Stack[T]) Clear ¶
func (a *Stack[T]) Clear()
Clears all elements, but does not reset the space.
func (*Stack[T]) Last ¶ added in v1.2.0
Return an element at the top of the stack, but does not remove it. Return None when the stack is empty.
func (*Stack[T]) RemoveLast ¶ added in v1.2.0
Remove an element from the top of the stack. Return None when the stack is empty.
Click to show internal directories.
Click to hide internal directories.