types

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2017 License: BSD-3-Clause, GPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteSliceMarshals

func ByteSliceMarshals() (ItemMarshal, ItemUnmarshal)

func DoChildCount

func DoChildCount(node BinaryTreeNode) int

func Int16Marshals

func Int16Marshals() (ItemMarshal, ItemUnmarshal)

func Int32Marshals

func Int32Marshals() (ItemMarshal, ItemUnmarshal)

func Int64Marshals

func Int64Marshals() (ItemMarshal, ItemUnmarshal)

func Int8Marshals

func Int8Marshals() (ItemMarshal, ItemUnmarshal)

func IntMarshals

func IntMarshals() (ItemMarshal, ItemUnmarshal)

func IsNil

func IsNil(object interface{}) bool

func MakeMarshals

func MakeMarshals(empty func() MHashable) (ItemMarshal, ItemUnmarshal)

func StringMarshals

func StringMarshals() (ItemMarshal, ItemUnmarshal)

func UInt16Marshals

func UInt16Marshals() (ItemMarshal, ItemUnmarshal)

func UInt32Marshals

func UInt32Marshals() (ItemMarshal, ItemUnmarshal)

func UInt64Marshals

func UInt64Marshals() (ItemMarshal, ItemUnmarshal)

func UInt8Marshals

func UInt8Marshals() (ItemMarshal, ItemUnmarshal)

func UIntMarshals

func UIntMarshals() (ItemMarshal, ItemUnmarshal)

Types

type BinaryTreeNode

type BinaryTreeNode interface {
	TreeNode
	Left() BinaryTreeNode
	Right() BinaryTreeNode
}

type ByteSlice

type ByteSlice []byte

func (ByteSlice) Equals

func (self ByteSlice) Equals(other Equatable) bool

func (ByteSlice) Hash

func (self ByteSlice) Hash() int

func (ByteSlice) Less

func (self ByteSlice) Less(other Sortable) bool

func (*ByteSlice) MarshalBinary

func (self *ByteSlice) MarshalBinary() ([]byte, error)

func (*ByteSlice) UnmarshalBinary

func (self *ByteSlice) UnmarshalBinary(data []byte) error

type ContainerOperable

type ContainerOperable interface {
	Has(item Hashable) bool
}

type Coroutine

type Coroutine func(send interface{}) (recv interface{}, next Coroutine)

type Deque

type Deque interface {
	Sized
	ContainerOperable
	DequeOperable
}

type DequeOperable

type DequeOperable interface {
	EnqueFront(item Hashable) (err error)
	EnqueBack(item Hashable) (err error)
	DequeFront() (item Hashable, err error)
	DequeBack() (item Hashable, err error)
	First() (item Hashable)
	Last() (item Hashable)
}

type Equatable

type Equatable interface {
	Equals(b Equatable) bool
}

type HList

type HList interface {
	Hashable
	List
}

type Hashable

type Hashable interface {
	Sortable
	Hash() int
}

type Int

type Int int

func (Int) Equals

func (self Int) Equals(other Equatable) bool

func (Int) Hash

func (self Int) Hash() int

func (Int) Less

func (self Int) Less(other Sortable) bool

func (*Int) MarshalBinary

func (self *Int) MarshalBinary() ([]byte, error)

func (*Int) UnmarshalBinary

func (self *Int) UnmarshalBinary(data []byte) error

type Int16

type Int16 int16

func (Int16) Equals

func (self Int16) Equals(other Equatable) bool

func (Int16) Hash

func (self Int16) Hash() int

func (Int16) Less

func (self Int16) Less(other Sortable) bool

func (*Int16) MarshalBinary

func (self *Int16) MarshalBinary() ([]byte, error)

func (*Int16) UnmarshalBinary

func (self *Int16) UnmarshalBinary(data []byte) error

type Int32

type Int32 int32

func (Int32) Equals

func (self Int32) Equals(other Equatable) bool

func (Int32) Hash

func (self Int32) Hash() int

func (Int32) Less

func (self Int32) Less(other Sortable) bool

func (*Int32) MarshalBinary

func (self *Int32) MarshalBinary() ([]byte, error)

func (*Int32) UnmarshalBinary

func (self *Int32) UnmarshalBinary(data []byte) error

type Int64

type Int64 int64

func (Int64) Equals

func (self Int64) Equals(other Equatable) bool

func (Int64) Hash

func (self Int64) Hash() int

func (Int64) Less

func (self Int64) Less(other Sortable) bool

func (*Int64) MarshalBinary

func (self *Int64) MarshalBinary() ([]byte, error)

func (*Int64) UnmarshalBinary

func (self *Int64) UnmarshalBinary(data []byte) error

type Int8

type Int8 int8

func (Int8) Equals

func (self Int8) Equals(other Equatable) bool

func (Int8) Hash

func (self Int8) Hash() int

func (Int8) Less

func (self Int8) Less(other Sortable) bool

func (*Int8) MarshalBinary

func (self *Int8) MarshalBinary() ([]byte, error)

func (*Int8) UnmarshalBinary

func (self *Int8) UnmarshalBinary(data []byte) error

type ItemMarshal

type ItemMarshal func(Hashable) ([]byte, error)

type ItemUnmarshal

type ItemUnmarshal func([]byte) (Hashable, error)

type ItemsOperable

type ItemsOperable interface {
	Sized
	ContainerOperable
	Item(item Hashable) (Hashable, error)
	Add(item Hashable) (err error)
	Delete(item Hashable) (err error)
	Extend(items KIterator) (err error)
}

type Iterable

type Iterable interface {
	Iterate() Iterator
}

type IterableContainer

type IterableContainer interface {
	Sized
	ListIterable
	Has(item Hashable) bool
}

type Iterator

type Iterator func() (item interface{}, next Iterator)

func MakeValuesIterator

func MakeValuesIterator(obj KVIterable) Iterator

type KIterable

type KIterable interface {
	Keys() KIterator
}

type KIterator

type KIterator func() (key Hashable, next KIterator)

func MakeItemsIterator

func MakeItemsIterator(obj KVIterable) (kit KIterator)

func MakeKeysIterator

func MakeKeysIterator(obj KVIterable) KIterator

type KVIterable

type KVIterable interface {
	Iterate() KVIterator
}

type KVIterator

type KVIterator func() (key Hashable, value interface{}, next KVIterator)

func MakeKVIteratorFromTreeNodeIterator

func MakeKVIteratorFromTreeNodeIterator(tni TreeNodeIterator) KVIterator

type Linked

type Linked interface {
	LinkedOperable
	ListIterable
}

type LinkedOperable

type LinkedOperable interface {
	Sized
	ContainerOperable
	StackOperable
	DequeOperable
}

type List

type List interface {
	ListIterable
	ListOperable
}

type ListIterable

type ListIterable interface {
	Items() KIterator
}

type ListOperable

type ListOperable interface {
	Sized
	ContainerOperable
	Append(item Hashable) (err error)
	Get(i int) (item Hashable, err error)
	Set(i int, item Hashable) (err error)
	Insert(i int, item Hashable) (err error)
	Remove(i int) (err error)
}

type MHashable

type MHashable interface {
	Hashable
	Marshaler
}

type Map

type Map interface {
	MapIterable
	MapOperable
}

type MapEntry

type MapEntry struct {
	Key   Hashable
	Value interface{}
}

func (*MapEntry) Equals

func (m *MapEntry) Equals(other Equatable) bool

func (*MapEntry) Hash

func (m *MapEntry) Hash() int

func (*MapEntry) Less

func (m *MapEntry) Less(other Sortable) bool

func (*MapEntry) String

func (m *MapEntry) String() string

type MapIterable

type MapIterable interface {
	KIterable
	VIterable
	KVIterable
}

type MapOperable

type MapOperable interface {
	Sized
	Has(key Hashable) bool
	Put(key Hashable, value interface{}) (err error)
	Get(key Hashable) (value interface{}, err error)
	Remove(key Hashable) (value interface{}, err error)
}

type Marshaler

type Marshaler interface {
	MarshalBinary() (data []byte, err error)
	UnmarshalBinary(data []byte) error
}

type MultiMap

type MultiMap interface {
	MapIterable
	MultiMapOperable
}

type MultiMapOperable

type MultiMapOperable interface {
	Sized
	Has(key Hashable) bool
	Count(key Hashable) int
	Add(key Hashable, value interface{}) (err error)
	Replace(key Hashable, where WhereFunc, value interface{}) (err error)
	Find(key Hashable) KVIterator
	RemoveWhere(key Hashable, where WhereFunc) (err error)
}

type OrderedList

type OrderedList interface {
	ListIterable
	OrderedOperable
}

type OrderedOperable

type OrderedOperable interface {
	Get(i int) (item Hashable, err error)
	Find(item Hashable) (idx int, has bool, err error)
}

type Set

type Set interface {
	Equatable
	ListIterable
	ItemsOperable
	Union(Set) (Set, error)
	Intersect(Set) (Set, error)
	Subtract(Set) (Set, error)
	Subset(Set) bool
	Superset(Set) bool
	ProperSubset(Set) bool
	ProperSuperset(Set) bool
}

type Sized

type Sized interface {
	Size() int
}

type Sortable

type Sortable interface {
	Equatable
	Less(b Sortable) bool
}

type Stack

type Stack interface {
	Sized
	ContainerOperable
	StackOperable
}

type StackOperable

type StackOperable interface {
	Push(item Hashable) (err error)
	Pop() (item Hashable, err error)
}

type String

type String string

func (String) Equals

func (self String) Equals(other Equatable) bool

func (String) Hash

func (self String) Hash() int

func (String) Less

func (self String) Less(other Sortable) bool

func (*String) MarshalBinary

func (self *String) MarshalBinary() ([]byte, error)

func (*String) UnmarshalBinary

func (self *String) UnmarshalBinary(data []byte) error

type Tree

type Tree interface {
	Root() TreeNode
}

type TreeMap

type TreeMap interface {
	Tree
	Map
}

type TreeNode

type TreeNode interface {
	Key() Hashable
	Value() interface{}
	Children() TreeNodeIterator
	GetChild(int) TreeNode // if your tree can't support this simply panic
	// many of the utility functions do not require this
	// however, it is recommended that you implement it
	// if possible (for instance, post-order traversal
	// requires it).
	ChildCount() int // a negative value indicates this tree can't provide

}

func DoGetChild

func DoGetChild(node BinaryTreeNode, i int) TreeNode

type TreeNodeIterator

type TreeNodeIterator func() (node TreeNode, next TreeNodeIterator)

func ChainTreeNodeIterators

func ChainTreeNodeIterators(tnis ...TreeNodeIterator) TreeNodeIterator

func MakeChildrenIterator

func MakeChildrenIterator(node BinaryTreeNode) TreeNodeIterator

type UInt

type UInt uint

func (UInt) Equals

func (self UInt) Equals(other Equatable) bool

func (UInt) Hash

func (self UInt) Hash() int

func (UInt) Less

func (self UInt) Less(other Sortable) bool

func (*UInt) MarshalBinary

func (self *UInt) MarshalBinary() ([]byte, error)

func (*UInt) UnmarshalBinary

func (self *UInt) UnmarshalBinary(data []byte) error

type UInt16

type UInt16 uint16

func (UInt16) Equals

func (self UInt16) Equals(other Equatable) bool

func (UInt16) Hash

func (self UInt16) Hash() int

func (UInt16) Less

func (self UInt16) Less(other Sortable) bool

func (*UInt16) MarshalBinary

func (self *UInt16) MarshalBinary() ([]byte, error)

func (*UInt16) UnmarshalBinary

func (self *UInt16) UnmarshalBinary(data []byte) error

type UInt32

type UInt32 uint32

func (UInt32) Equals

func (self UInt32) Equals(other Equatable) bool

func (UInt32) Hash

func (self UInt32) Hash() int

func (UInt32) Less

func (self UInt32) Less(other Sortable) bool

func (*UInt32) MarshalBinary

func (self *UInt32) MarshalBinary() ([]byte, error)

func (*UInt32) UnmarshalBinary

func (self *UInt32) UnmarshalBinary(data []byte) error

type UInt64

type UInt64 uint64

func (UInt64) Equals

func (self UInt64) Equals(other Equatable) bool

func (UInt64) Hash

func (self UInt64) Hash() int

func (UInt64) Less

func (self UInt64) Less(other Sortable) bool

func (*UInt64) MarshalBinary

func (self *UInt64) MarshalBinary() ([]byte, error)

func (*UInt64) UnmarshalBinary

func (self *UInt64) UnmarshalBinary(data []byte) error

type UInt8

type UInt8 uint8

func (UInt8) Equals

func (self UInt8) Equals(other Equatable) bool

func (UInt8) Hash

func (self UInt8) Hash() int

func (UInt8) Less

func (self UInt8) Less(other Sortable) bool

func (*UInt8) MarshalBinary

func (self *UInt8) MarshalBinary() ([]byte, error)

func (*UInt8) UnmarshalBinary

func (self *UInt8) UnmarshalBinary(data []byte) error

type VIterable

type VIterable interface {
	Values() Iterator
}

type WhereFunc

type WhereFunc func(value interface{}) bool

Jump to

Keyboard shortcuts

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