Documentation ¶
Index ¶
- type Slice
- func (pointer *Slice) Append(value interface{}) *Slice
- func (pointer *Slice) Assign(values ...interface{}) *Slice
- func (pointer *Slice) Bounds(i int) bool
- func (pointer *Slice) Concatenate(slice *Slice) *Slice
- func (pointer *Slice) Each(f func(i int, value interface{})) *Slice
- func (pointer *Slice) Fetch(i int) interface{}
- func (pointer *Slice) Get(i int) (interface{}, bool)
- func (pointer *Slice) Join(character string) string
- func (pointer *Slice) Len() int
- func (pointer *Slice) Less(i, j int) bool
- func (pointer *Slice) Map(f func(i int, value interface{}) interface{}) *Slice
- func (pointer *Slice) Poll() interface{}
- func (pointer *Slice) Pop() interface{}
- func (pointer *Slice) Preassign(values ...interface{}) *Slice
- func (pointer *Slice) Precatenate(slice *Slice) *Slice
- func (pointer *Slice) Prepend(value interface{}) *Slice
- func (pointer *Slice) Replace(i int, value interface{}) bool
- func (pointer *Slice) Slice(start, end int) *Slice
- func (pointer *Slice) Sort() *Slice
- func (pointer *Slice) Splice(start, end int) *Slice
- func (pointer *Slice) Swap(i int, j int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Slice ¶
type Slice []interface{}
Slice is a list-like object whose methods are used to perform traversal and mutation operations.
func New ¶
func New(values ...interface{}) *Slice
New instantiates a new empty or populated, Slice pointer. Slice pointers are mutable and hold and arguments as an interface. Any dataset retrieved from the Slice is intended to be cast to a required type. Unlike basic list-like objects, the Slice provides safe getters and setters, aiming to reduce the likelyhood of an exception being thrown during an operation.
func (*Slice) Append ¶
Append method adds one element to the end of the Slice and returns the modified Slice.
func (*Slice) Assign ¶
Assign method adds zero or more elements to the beginning of the Slice and returns the modified Slice.
func (*Slice) Bounds ¶
Bounds checks an integer value safely sits within the range of accessible values for the Slice.
func (*Slice) Concatenate ¶
Concatenate merges two Slices into a single Slice.
func (*Slice) Fetch ¶
Fetch retrieves the interface held at the argument index. Returns nil if index exceeds Slice length.
func (*Slice) Get ¶
Get returns the interface held at the argument index and a boolean indicating if it was successfully retrieved.
func (*Slice) Less ¶
Less checks the string value of two elements in the slice and checks which element has the lower value.
func (*Slice) Map ¶
Map method executes a provided function once for each Slice elements and sets the returned value to the current index.
func (*Slice) Poll ¶
func (pointer *Slice) Poll() interface{}
Poll method removes the first element from the Slice and returns that removed element. This method changes the length of the Slice.
func (*Slice) Pop ¶
func (pointer *Slice) Pop() interface{}
Pop method removes the last element from the Slice and returns that element. This method changes the length of the array.
func (*Slice) Preassign ¶
Preassign method adds zero or more elements to the beginning of the Slice and returns the modified Slice.
func (*Slice) Precatenate ¶
Precatenate merges two Slices, prepending the argument Slice.
func (*Slice) Prepend ¶
Prepend method adds one element to the beginning of the Slice and returns the modified Slice.
func (*Slice) Replace ¶
Replace method changes the contents of the Slice at the argument index if it is in bounds.
func (*Slice) Slice ¶
Slice method returns a shallow copy of a portion of the Slice into a new Slice type selected from begin to end (end not included). The original Slice will not be modified.