Documentation ¶
Index ¶
- type Array
- func (a *Array[T]) At(pos int) T
- func (a *Array[T]) Back() T
- func (a *Array[T]) Begin() *ArrayIterator[T]
- func (a *Array[T]) Data() []T
- func (a *Array[T]) Empty() bool
- func (a *Array[T]) End() *ArrayIterator[T]
- func (a *Array[T]) Fill(val T)
- func (a *Array[T]) First() *ArrayIterator[T]
- func (a *Array[T]) Front() T
- func (a *Array[T]) IterAt(pos int) *ArrayIterator[T]
- func (a *Array[T]) Last() *ArrayIterator[T]
- func (a *Array[T]) Set(pos int, val T)
- func (a *Array[T]) Size() int
- func (a *Array[T]) String() string
- func (a *Array[T]) SwapArray(other *Array[T])
- type ArrayIterator
- func (iter *ArrayIterator[T]) Clone() iterator.ConstIterator[T]
- func (iter *ArrayIterator[T]) Equal(other iterator.ConstIterator[T]) bool
- func (iter *ArrayIterator[T]) IsValid() bool
- func (iter *ArrayIterator[T]) IteratorAt(pos int) iterator.RandomAccessIterator[T]
- func (iter *ArrayIterator[T]) Next() iterator.ConstIterator[T]
- func (iter *ArrayIterator[T]) Position() int
- func (iter *ArrayIterator[T]) Prev() iterator.ConstBidIterator[T]
- func (iter *ArrayIterator[T]) SetValue(val T)
- func (iter *ArrayIterator[T]) Value() T
- type T
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array[T any] struct { // contains filtered or unexported fields }
Array is a fixed size slice
func NewFromArray ¶
NewFromArray creates a new array from another array, and copy its values
func (*Array[T]) Begin ¶
func (a *Array[T]) Begin() *ArrayIterator[T]
Begin returns an iterator of the array with the first position
func (*Array[T]) End ¶
func (a *Array[T]) End() *ArrayIterator[T]
End returns an iterator of the array with the position a.Size()
func (*Array[T]) First ¶
func (a *Array[T]) First() *ArrayIterator[T]
First returns an iterator of the array with the first position
func (*Array[T]) IterAt ¶
func (a *Array[T]) IterAt(pos int) *ArrayIterator[T]
IterAt returns an iterator of the array with position pos
func (*Array[T]) Last ¶
func (a *Array[T]) Last() *ArrayIterator[T]
Last returns an iterator of the array with the last position
type ArrayIterator ¶
type ArrayIterator[T any] struct { // contains filtered or unexported fields }
ArrayIterator is an implementation of Array iterator
func (*ArrayIterator[T]) Clone ¶
func (iter *ArrayIterator[T]) Clone() iterator.ConstIterator[T]
Clone clones the iterator to a new iterator
func (*ArrayIterator[T]) Equal ¶
func (iter *ArrayIterator[T]) Equal(other iterator.ConstIterator[T]) bool
Equal returns true if the iterator is equal to the passed iterator, otherwise returns false
func (*ArrayIterator[T]) IsValid ¶
func (iter *ArrayIterator[T]) IsValid() bool
IsValid returns true if the iterator is valid, otherwise returns false
func (*ArrayIterator[T]) IteratorAt ¶
func (iter *ArrayIterator[T]) IteratorAt(pos int) iterator.RandomAccessIterator[T]
IteratorAt creates a new iterator with position pos
func (*ArrayIterator[T]) Next ¶
func (iter *ArrayIterator[T]) Next() iterator.ConstIterator[T]
Next moves the position of iterator to the next position and returns itself
func (*ArrayIterator[T]) Position ¶
func (iter *ArrayIterator[T]) Position() int
Position returns the position of the iterator
func (*ArrayIterator[T]) Prev ¶
func (iter *ArrayIterator[T]) Prev() iterator.ConstBidIterator[T]
Prev moves the position of iterator to the previous position and returns itself
func (*ArrayIterator[T]) SetValue ¶
func (iter *ArrayIterator[T]) SetValue(val T)
SetValue sets the value of the array at the position of the iterator point to
func (*ArrayIterator[T]) Value ¶
func (iter *ArrayIterator[T]) Value() T
Value returns the value of array at the position of the iterator point to