On this page
tmux.SparseArray
- Module
- tmux
- Package
- github.com/libtmux/libtmux-go/tmux
- Source
- tmux/sparse_array.go
-
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.
8 declared, 0 inherited
Members
- All method All returns an iterator over indices and values in ascending index order.
- Append method Append returns a copy with value stored after the highest present index. It leaves the receiver unchanged and returns an error matching
ErrInvalidSparseIndexwhen that index overflows. - Entries method Entries returns a fresh shallow copy in ascending index order.
- 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.
- Indices method Indices returns a fresh slice of present indices in ascending order.
- Len method Len returns the number of present entries, not the highest index.
- Values method Values returns a fresh shallow slice 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
ErrInvalidSparseIndexfor a negative index.