data-structures: github.com/timtadh/data-structures/types Index | Files

package types

import "github.com/timtadh/data-structures/types"

Index

Package Files

int.go map_entry.go string.go types.go util.go

func DoChildCount Uses

func DoChildCount(node BinaryTreeNode) int

func IsNil Uses

func IsNil(object interface{}) bool

type BinaryTreeNode Uses

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

type ByteSlice Uses

type ByteSlice []byte

func (ByteSlice) Equals Uses

func (self ByteSlice) Equals(other Equatable) bool

func (ByteSlice) Hash Uses

func (self ByteSlice) Hash() int

func (ByteSlice) Less Uses

func (self ByteSlice) Less(other Sortable) bool

func (*ByteSlice) MarshalBinary Uses

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

func (*ByteSlice) UnmarshalBinary Uses

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

type ContainerOperable Uses

type ContainerOperable interface {
    Has(item Hashable) bool
}

type Coroutine Uses

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

type Deque Uses

type Deque interface {
    Sized
    ContainerOperable
    DequeOperable
}

type DequeOperable Uses

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 Uses

type Equatable interface {
    Equals(b Equatable) bool
}

type HList Uses

type HList interface {
    Hashable
    List
}

type Hashable Uses

type Hashable interface {
    Sortable
    Hash() int
}

type Int Uses

type Int int

func (Int) Equals Uses

func (self Int) Equals(other Equatable) bool

func (Int) Hash Uses

func (self Int) Hash() int

func (Int) Less Uses

func (self Int) Less(other Sortable) bool

func (*Int) MarshalBinary Uses

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

func (*Int) UnmarshalBinary Uses

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

type Int16 Uses

type Int16 int16

func (Int16) Equals Uses

func (self Int16) Equals(other Equatable) bool

func (Int16) Hash Uses

func (self Int16) Hash() int

func (Int16) Less Uses

func (self Int16) Less(other Sortable) bool

func (*Int16) MarshalBinary Uses

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

func (*Int16) UnmarshalBinary Uses

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

type Int32 Uses

type Int32 int32

func (Int32) Equals Uses

func (self Int32) Equals(other Equatable) bool

func (Int32) Hash Uses

func (self Int32) Hash() int

func (Int32) Less Uses

func (self Int32) Less(other Sortable) bool

func (*Int32) MarshalBinary Uses

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

func (*Int32) UnmarshalBinary Uses

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

type Int64 Uses

type Int64 int64

func (Int64) Equals Uses

func (self Int64) Equals(other Equatable) bool

func (Int64) Hash Uses

func (self Int64) Hash() int

func (Int64) Less Uses

func (self Int64) Less(other Sortable) bool

func (*Int64) MarshalBinary Uses

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

func (*Int64) UnmarshalBinary Uses

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

type Int8 Uses

type Int8 int8

func (Int8) Equals Uses

func (self Int8) Equals(other Equatable) bool

func (Int8) Hash Uses

func (self Int8) Hash() int

func (Int8) Less Uses

func (self Int8) Less(other Sortable) bool

func (*Int8) MarshalBinary Uses

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

func (*Int8) UnmarshalBinary Uses

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

type ItemMarshal Uses

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

func ByteSliceMarshals Uses

func ByteSliceMarshals() (ItemMarshal, ItemUnmarshal)

func Int16Marshals Uses

func Int16Marshals() (ItemMarshal, ItemUnmarshal)

func Int32Marshals Uses

func Int32Marshals() (ItemMarshal, ItemUnmarshal)

func Int64Marshals Uses

func Int64Marshals() (ItemMarshal, ItemUnmarshal)

func Int8Marshals Uses

func Int8Marshals() (ItemMarshal, ItemUnmarshal)

func IntMarshals Uses

func IntMarshals() (ItemMarshal, ItemUnmarshal)

func MakeMarshals Uses

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

func StringMarshals Uses

func StringMarshals() (ItemMarshal, ItemUnmarshal)

func UInt16Marshals Uses

func UInt16Marshals() (ItemMarshal, ItemUnmarshal)

func UInt32Marshals Uses

func UInt32Marshals() (ItemMarshal, ItemUnmarshal)

func UInt64Marshals Uses

func UInt64Marshals() (ItemMarshal, ItemUnmarshal)

func UInt8Marshals Uses

func UInt8Marshals() (ItemMarshal, ItemUnmarshal)

func UIntMarshals Uses

func UIntMarshals() (ItemMarshal, ItemUnmarshal)

type ItemUnmarshal Uses

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

type ItemsOperable Uses

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 Uses

type Iterable interface {
    Iterate() Iterator
}

type IterableContainer Uses

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

type Iterator Uses

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

func MakeValuesIterator Uses

func MakeValuesIterator(obj KVIterable) Iterator

type KIterable Uses

type KIterable interface {
    Keys() KIterator
}

type KIterator Uses

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

func MakeItemsIterator Uses

func MakeItemsIterator(obj KVIterable) (kit KIterator)

func MakeKeysIterator Uses

func MakeKeysIterator(obj KVIterable) KIterator

type KVIterable Uses

type KVIterable interface {
    Iterate() KVIterator
}

type KVIterator Uses

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

func MakeKVIteratorFromTreeNodeIterator Uses

func MakeKVIteratorFromTreeNodeIterator(tni TreeNodeIterator) KVIterator

type Linked Uses

type Linked interface {
    LinkedOperable
    ListIterable
}

type LinkedOperable Uses

type LinkedOperable interface {
    Sized
    ContainerOperable
    StackOperable
    DequeOperable
}

type List Uses

type List interface {
    ListIterable
    ListOperable
}

type ListIterable Uses

type ListIterable interface {
    Items() KIterator
}

type ListOperable Uses

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 Uses

type MHashable interface {
    Hashable
    Marshaler
}

type Map Uses

type Map interface {
    MapIterable
    MapOperable
}

type MapEntry Uses

type MapEntry struct {
    Key   Hashable
    Value interface{}
}

func (*MapEntry) Equals Uses

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

func (*MapEntry) Hash Uses

func (m *MapEntry) Hash() int

func (*MapEntry) Less Uses

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

func (*MapEntry) String Uses

func (m *MapEntry) String() string

type MapIterable Uses

type MapIterable interface {
    KIterable
    VIterable
    KVIterable
}

type MapOperable Uses

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 Uses

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

type MultiMap Uses

type MultiMap interface {
    MapIterable
    MultiMapOperable
}

type MultiMapOperable Uses

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 Uses

type OrderedList interface {
    ListIterable
    OrderedOperable
}

type OrderedOperable Uses

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

type Set Uses

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 Uses

type Sized interface {
    Size() int
}

type Sortable Uses

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

type Stack Uses

type Stack interface {
    Sized
    ContainerOperable
    StackOperable
}

type StackOperable Uses

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

type String Uses

type String string

func (String) Equals Uses

func (self String) Equals(other Equatable) bool

func (String) Hash Uses

func (self String) Hash() int

func (String) Less Uses

func (self String) Less(other Sortable) bool

func (*String) MarshalBinary Uses

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

func (*String) UnmarshalBinary Uses

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

type Tree Uses

type Tree interface {
    Root() TreeNode
}

type TreeMap Uses

type TreeMap interface {
    Tree
    Map
}

type TreeNode Uses

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 Uses

func DoGetChild(node BinaryTreeNode, i int) TreeNode

type TreeNodeIterator Uses

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

func ChainTreeNodeIterators Uses

func ChainTreeNodeIterators(tnis ...TreeNodeIterator) TreeNodeIterator

func MakeChildrenIterator Uses

func MakeChildrenIterator(node BinaryTreeNode) TreeNodeIterator

type UInt Uses

type UInt uint

func (UInt) Equals Uses

func (self UInt) Equals(other Equatable) bool

func (UInt) Hash Uses

func (self UInt) Hash() int

func (UInt) Less Uses

func (self UInt) Less(other Sortable) bool

func (*UInt) MarshalBinary Uses

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

func (*UInt) UnmarshalBinary Uses

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

type UInt16 Uses

type UInt16 uint16

func (UInt16) Equals Uses

func (self UInt16) Equals(other Equatable) bool

func (UInt16) Hash Uses

func (self UInt16) Hash() int

func (UInt16) Less Uses

func (self UInt16) Less(other Sortable) bool

func (*UInt16) MarshalBinary Uses

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

func (*UInt16) UnmarshalBinary Uses

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

type UInt32 Uses

type UInt32 uint32

func (UInt32) Equals Uses

func (self UInt32) Equals(other Equatable) bool

func (UInt32) Hash Uses

func (self UInt32) Hash() int

func (UInt32) Less Uses

func (self UInt32) Less(other Sortable) bool

func (*UInt32) MarshalBinary Uses

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

func (*UInt32) UnmarshalBinary Uses

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

type UInt64 Uses

type UInt64 uint64

func (UInt64) Equals Uses

func (self UInt64) Equals(other Equatable) bool

func (UInt64) Hash Uses

func (self UInt64) Hash() int

func (UInt64) Less Uses

func (self UInt64) Less(other Sortable) bool

func (*UInt64) MarshalBinary Uses

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

func (*UInt64) UnmarshalBinary Uses

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

type UInt8 Uses

type UInt8 uint8

func (UInt8) Equals Uses

func (self UInt8) Equals(other Equatable) bool

func (UInt8) Hash Uses

func (self UInt8) Hash() int

func (UInt8) Less Uses

func (self UInt8) Less(other Sortable) bool

func (*UInt8) MarshalBinary Uses

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

func (*UInt8) UnmarshalBinary Uses

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

type VIterable Uses

type VIterable interface {
    Values() Iterator
}

type WhereFunc Uses

type WhereFunc func(value interface{}) bool

Package types imports 6 packages (graph) and is imported by 19 packages. Updated 2016-07-21. Refresh now. Tools for package owners.