Documentation ¶
Overview ¶
Package bufferediskiplist provides a version of ISkipList that (i) buffers insertions at the start and end of the sequence and (ii) does not construct a skip list structure until the sequence reaches a certain length. This reduces the overhead of using an ISkipList in instances where the sequence of values is often short.
The API for BufferedISkipList is the same as for ISkipList but for one important difference in the semantics of PtrAt(). Pointers to elements in a BufferedISkiplist are **NOT** guaranteed to remain valid following subsequent mutation of the BufferedISkipList. (Any operation that adds or removes an element is a mutation; merely modifying an element's value doesn't count.)
Index ¶
- type BufferedISkipList
- func (l *BufferedISkipList) At(i int) iskiplist.ElemType
- func (l *BufferedISkipList) Clear()
- func (l *BufferedISkipList) Copy() *BufferedISkipList
- func (l *BufferedISkipList) CopyRange(from, to int) *BufferedISkipList
- func (l *BufferedISkipList) CopyRangeToSlice(from, to int, slice []iskiplist.ElemType)
- func (l *BufferedISkipList) CopyToSlice(slice []iskiplist.ElemType)
- func (l *BufferedISkipList) ForAll(f func(*iskiplist.ElemType))
- func (l *BufferedISkipList) ForAllI(f func(int, *iskiplist.ElemType))
- func (l *BufferedISkipList) ForAllRange(from, to int, f func(*iskiplist.ElemType))
- func (l *BufferedISkipList) ForAllRangeI(from, to int, f func(int, *iskiplist.ElemType))
- func (l *BufferedISkipList) Insert(index int, elem iskiplist.ElemType)
- func (l *BufferedISkipList) Iterate(f func(*iskiplist.ElemType) bool)
- func (l *BufferedISkipList) IterateI(f func(int, *iskiplist.ElemType) bool)
- func (l *BufferedISkipList) IterateRange(from, to int, f func(*iskiplist.ElemType) bool)
- func (l *BufferedISkipList) IterateRangeI(from, to int, f func(int, *iskiplist.ElemType) bool)
- func (l *BufferedISkipList) Length() int
- func (l *BufferedISkipList) PopBack() (r iskiplist.ElemType, ok bool)
- func (l *BufferedISkipList) PopFront() (r iskiplist.ElemType, ok bool)
- func (l *BufferedISkipList) PtrAt(i int) *iskiplist.ElemType
- func (l *BufferedISkipList) PushBack(elem iskiplist.ElemType)
- func (l *BufferedISkipList) PushFront(elem iskiplist.ElemType)
- func (l *BufferedISkipList) Remove(index int) iskiplist.ElemType
- func (l *BufferedISkipList) Seed(seed1, seed2 uint64)
- func (l *BufferedISkipList) SeedFrom(l2 *BufferedISkipList)
- func (l *BufferedISkipList) Set(i int, v iskiplist.ElemType)
- func (l *BufferedISkipList) Swap(index1, index2 int)
- func (l *BufferedISkipList) Truncate(n int)
- func (l *BufferedISkipList) Update(i int, upd func(iskiplist.ElemType) iskiplist.ElemType)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BufferedISkipList ¶
type BufferedISkipList struct {
// contains filtered or unexported fields
}
func (*BufferedISkipList) Clear ¶
func (l *BufferedISkipList) Clear()
func (*BufferedISkipList) Copy ¶
func (l *BufferedISkipList) Copy() *BufferedISkipList
func (*BufferedISkipList) CopyRange ¶
func (l *BufferedISkipList) CopyRange(from, to int) *BufferedISkipList
func (*BufferedISkipList) CopyRangeToSlice ¶
func (l *BufferedISkipList) CopyRangeToSlice(from, to int, slice []iskiplist.ElemType)
func (*BufferedISkipList) CopyToSlice ¶
func (l *BufferedISkipList) CopyToSlice(slice []iskiplist.ElemType)
func (*BufferedISkipList) ForAll ¶
func (l *BufferedISkipList) ForAll(f func(*iskiplist.ElemType))
func (*BufferedISkipList) ForAllI ¶
func (l *BufferedISkipList) ForAllI(f func(int, *iskiplist.ElemType))
func (*BufferedISkipList) ForAllRange ¶
func (l *BufferedISkipList) ForAllRange(from, to int, f func(*iskiplist.ElemType))
func (*BufferedISkipList) ForAllRangeI ¶
func (l *BufferedISkipList) ForAllRangeI(from, to int, f func(int, *iskiplist.ElemType))
func (*BufferedISkipList) Insert ¶
func (l *BufferedISkipList) Insert(index int, elem iskiplist.ElemType)
func (*BufferedISkipList) Iterate ¶
func (l *BufferedISkipList) Iterate(f func(*iskiplist.ElemType) bool)
func (*BufferedISkipList) IterateI ¶
func (l *BufferedISkipList) IterateI(f func(int, *iskiplist.ElemType) bool)
func (*BufferedISkipList) IterateRange ¶
func (l *BufferedISkipList) IterateRange(from, to int, f func(*iskiplist.ElemType) bool)
func (*BufferedISkipList) IterateRangeI ¶
func (*BufferedISkipList) Length ¶
func (l *BufferedISkipList) Length() int
func (*BufferedISkipList) PopBack ¶
func (l *BufferedISkipList) PopBack() (r iskiplist.ElemType, ok bool)
func (*BufferedISkipList) PopFront ¶
func (l *BufferedISkipList) PopFront() (r iskiplist.ElemType, ok bool)
func (*BufferedISkipList) PushBack ¶
func (l *BufferedISkipList) PushBack(elem iskiplist.ElemType)
func (*BufferedISkipList) PushFront ¶
func (l *BufferedISkipList) PushFront(elem iskiplist.ElemType)
func (*BufferedISkipList) Seed ¶
func (l *BufferedISkipList) Seed(seed1, seed2 uint64)
func (*BufferedISkipList) SeedFrom ¶
func (l *BufferedISkipList) SeedFrom(l2 *BufferedISkipList)
func (*BufferedISkipList) Swap ¶
func (l *BufferedISkipList) Swap(index1, index2 int)
func (*BufferedISkipList) Truncate ¶
func (l *BufferedISkipList) Truncate(n int)