# tmux.SparseArray

- **Module:** tmux
- **Package:** github.com/libtmux/libtmux-go/tmux
- **Language:** Go
- **Kind:** struct
- **Source:** https://github.com/libtmux/libtmux-go/blob/52968a3181c1c9e6d1b26c565d4b170968ae61c0/tmux/sparse_array.go#L28
- **Page:** https://libtmux.org/en/go/latest/reference/tmux-sparsearray/

SparseArray stores values at sorted, nonnegative indices. Its zero value is an empty array. Constructors and functional updates own their entry slices; copies of reference-bearing T values remain shallow.

## Members

- `Get` (method): Get returns the value at index and reports whether it is present. A missing index, including a sparse hole, returns the zero value and false.
- `Len` (method): Len returns the number of present entries, not the highest index.
- `Indices` (method): Indices returns a fresh slice of present indices in ascending order.
- `Entries` (method): Entries returns a fresh shallow copy in ascending index order.
- `Values` (method): Values returns a fresh shallow slice in ascending index order.
- `All` (method): All returns an iterator over indices and values in ascending index order.
- `With` (method): With returns a copy with value inserted or replaced at index. It leaves the receiver unchanged and returns an error matching [ErrInvalidSparseIndex] for a negative index.
- `Append` (method): Append returns a copy with value stored after the highest present index. It leaves the receiver unchanged and returns an error matching [ErrInvalidSparseIndex] when that index overflows.
