Documentation
¶
Index ¶
- type CycList
- func (c *CycList) Append(v interface{})
- func (c CycList) At(i int) interface{}
- func (c CycList) Clone() (r *CycList)
- func (c *CycList) Concatenate(i interface{})
- func (c CycList) Cycle(f func(interface{}))
- func (c CycList) Equal(o interface{}) (r bool)
- func (c *CycList) Reverse()
- func (c *CycList) Rotate(i int)
- func (c CycList) Set(i int, v interface{})
- func (c *CycList) Tail()
- type Equatable
- type Flattenable
- type Iterable
- type Linear
- type LinearList
- func (l *LinearList) Absorb(i int, o *LinearList) (ok bool)
- func (l LinearList) Clone() *LinearList
- func (l *LinearList) Cut(start, end int) (r LinearList)
- func (l *LinearList) Delete(from, to int)
- func (l LinearList) End() chain.Node
- func (l LinearList) Equal(o interface{}) (r bool)
- func (l *LinearList) Insert(i int, o interface{})
- type Linkable
- type ListHeader
- func (l *ListHeader) Append(v interface{})
- func (l ListHeader) At(i int) (r interface{})
- func (l ListHeader) Clear(i int)
- func (l ListHeader) Clone() (r *ListHeader)
- func (l ListHeader) Compact() []interface{}
- func (l *ListHeader) Concatenate(s interface{})
- func (l ListHeader) Each(f func(interface{}))
- func (l ListHeader) End() chain.Node
- func (l ListHeader) EnforceBounds(start, end *int) (ok bool)
- func (l ListHeader) Equal(o interface{}) (r bool)
- func (l *ListHeader) Erase()
- func (l *ListHeader) Expand(i, n int)
- func (l *ListHeader) Flatten()
- func (l ListHeader) Head() (r interface{})
- func (l ListHeader) Len() (c int)
- func (l ListHeader) NewListNode(value interface{}) (n chain.Node)
- func (l *ListHeader) Reverse()
- func (l ListHeader) Set(i int, v interface{})
- func (l ListHeader) Start() chain.Node
- func (l ListHeader) String() (t string)
- func (l *ListHeader) Tail()
- type Sequence
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CycList ¶
type CycList struct {
ListHeader
}
func NewCycList ¶
func (*CycList) Concatenate ¶
func (c *CycList) Concatenate(i interface{})
func (CycList) Cycle ¶
func (c CycList) Cycle(f func(interface{}))
Iterate over all elements of the list indefinitely The only way to terminate iteration is by raising a panic() in the applied function
func (CycList) Equal ¶
Determines if another object is equivalent to the CycList Two CycLists are identical if they both have the same number of nodes, and the head of each node is the same
func (*CycList) Reverse ¶
func (c *CycList) Reverse()
Reverses the order in which elements of a CycList are traversed
type Flattenable ¶
type Flattenable interface {
Flatten()
}
type LinearList ¶
type LinearList struct {
ListHeader
}
func List ¶
func List(items ...interface{}) (l *LinearList)
func NewLinearList ¶
func NewLinearList(n chain.Node) *LinearList
func (*LinearList) Absorb ¶
func (l *LinearList) Absorb(i int, o *LinearList) (ok bool)
Take all the elements from another list and insert them into this list, destroying the other list if successful.
func (LinearList) Clone ¶
func (l LinearList) Clone() *LinearList
func (*LinearList) Cut ¶
func (l *LinearList) Cut(start, end int) (r LinearList)
Removes the elements in the range from the current list and returns a new list containing them.
func (*LinearList) Delete ¶
func (l *LinearList) Delete(from, to int)
Removes all elements in the range from the list.
func (LinearList) End ¶
func (l LinearList) End() chain.Node
func (LinearList) Equal ¶
func (l LinearList) Equal(o interface{}) (r bool)
Determines if another object is equivalent to the LinearList Two LinearLists are identical if they both have the same number of nodes, and the head of each node is the same
func (*LinearList) Insert ¶
func (l *LinearList) Insert(i int, o interface{})
Insert an item into the list at the given location.
type ListHeader ¶
type ListHeader struct {
// contains filtered or unexported fields
}
func NewListHeader ¶
func NewListHeader(n chain.Node) ListHeader
func (*ListHeader) Append ¶
func (l *ListHeader) Append(v interface{})
func (ListHeader) At ¶
func (l ListHeader) At(i int) (r interface{})
func (ListHeader) Clear ¶
func (l ListHeader) Clear(i int)
func (ListHeader) Clone ¶
func (l ListHeader) Clone() (r *ListHeader)
func (ListHeader) Compact ¶
func (l ListHeader) Compact() []interface{}
func (*ListHeader) Concatenate ¶
func (l *ListHeader) Concatenate(s interface{})
func (ListHeader) Each ¶
func (l ListHeader) Each(f func(interface{}))
func (ListHeader) End ¶
func (l ListHeader) End() chain.Node
func (ListHeader) EnforceBounds ¶
func (l ListHeader) EnforceBounds(start, end *int) (ok bool)
func (ListHeader) Equal ¶
func (l ListHeader) Equal(o interface{}) (r bool)
func (*ListHeader) Erase ¶
func (l *ListHeader) Erase()
func (*ListHeader) Expand ¶
func (l *ListHeader) Expand(i, n int)
func (*ListHeader) Flatten ¶
func (l *ListHeader) Flatten()
Iterates through the list reducing the nesting of each element which can be flattened. Elements which are themselves LinearLists will be inlined as part of the containing list and their contained list destroyed.
func (ListHeader) Head ¶
func (l ListHeader) Head() (r interface{})
func (ListHeader) Len ¶
func (l ListHeader) Len() (c int)
func (ListHeader) NewListNode ¶
func (l ListHeader) NewListNode(value interface{}) (n chain.Node)
func (*ListHeader) Reverse ¶
func (l *ListHeader) Reverse()
Reverses the order in which elements of a List are traversed
func (ListHeader) Set ¶
func (l ListHeader) Set(i int, v interface{})
func (ListHeader) Start ¶
func (l ListHeader) Start() chain.Node
func (ListHeader) String ¶
func (l ListHeader) String() (t string)
func (*ListHeader) Tail ¶
func (l *ListHeader) Tail()