hlist

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 28, 2014 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Element

type Element struct {

	// The value stored with this element.
	Value interface{}
	// contains filtered or unexported fields
}

Element is an element of a linked hlist.

func (*Element) Next

func (e *Element) Next() *Element

Next returns the next hlist element or nil.

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

Head is an head of a linked hlist.

type Hlist

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

Hlist represents a doubly linked hlist. The zero value for Hlist is an empty Hlist ready to use.

func New

func New() *Hlist

New returns an initialized hlist.

func (*Hlist) Front

func (l *Hlist) Front() *Element

Front returns the first element of hlist l or nil

func (*Hlist) Init

func (l *Hlist) Init() *Hlist

Init initializes or clears hlist l.

func (*Hlist) Len

func (l *Hlist) Len() int

Len returns the number of elements of hlist l. The complexity is O(1).

func (*Hlist) PushFront

func (l *Hlist) PushFront(v interface{}) *Element

PushFront inserts a new element e with value v at the front of hlist l and returns e.

func (*Hlist) Remove

func (l *Hlist) Remove(e *Element) interface{}

Remove removes e from l if e is an element of hlist l. It returns the element value e.Value.

Jump to

Keyboard shortcuts

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