orderedlist

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2013 License: MIT Imports: 2 Imported by: 4

README

orderedlist Build Status

orderedlist is an ordered list (not obvious, I know) for Go.

API Documentation

The GoDoc generated documentation is here.

License

MIT.

Documentation

Overview

Package orderedlist is a basic wrapper around container/list.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Comparable

type Comparable interface {
	Compare(c interface{}) int
}

type OrderedList

type OrderedList struct {
	// contains filtered or unexported fields
}

OrderedList is an ordered linked list.

func New

func New() *OrderedList

New returns an initialized OrderedList.

func (*OrderedList) GetRange

func (l *OrderedList) GetRange(start Comparable, end Comparable) (keys []Comparable)

GetRange returns a slice of Comparables in the range [start, end).

func (*OrderedList) GetRangeIterator added in v1.0.0

func (l *OrderedList) GetRangeIterator(start, end Comparable) *RangeIterator

GetRangeIterator returns a pointer to a RangeIterator.

func (*OrderedList) Insert

func (l *OrderedList) Insert(c Comparable)

Insert inserts a key string into the ordered list.

func (*OrderedList) Print

func (l *OrderedList) Print()

Print prints the values stored in the list.

func (*OrderedList) Remove

func (l *OrderedList) Remove(c Comparable)

Remove removes a key from the ordered list.

type RangeIterator added in v1.0.0

type RangeIterator struct {
	// contains filtered or unexported fields
}

func (*RangeIterator) Next added in v1.0.0

func (r *RangeIterator) Next() *RangeIterator

Next returns a pointer to the next RangeIterator. Nil is returned if the next value is out of the original range requested.

func (*RangeIterator) Prev added in v1.0.0

func (r *RangeIterator) Prev() *RangeIterator

Prev returns a pointer to the next RangeIterator. Nil is returned if the previous value is out of the original range requested.

func (*RangeIterator) Value added in v1.0.0

func (r *RangeIterator) Value() Comparable

Value returns the comparable value at the current element.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL