generated

package
v0.0.0-...-e0ee87b Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: MIT Imports: 8 Imported by: 10

Documentation

Overview

Package treeset implements a Tree backed by a red-black Tree.

Structure is not thread safe.

Reference: http://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package treeset implements a Tree backed by a red-black Tree.

Structure is not thread safe.

Reference: http://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package treemap implements a map backed by red-black Tree.

Elements are ordered by key in the map.

Structure is not thread safe.

Reference: http://en.wikipedia.org/wiki/Associative_array

Package treemap implements a map backed by red-black Tree.

Elements are ordered by key in the map.

Structure is not thread safe.

Reference: http://en.wikipedia.org/wiki/Associative_array

Package treeset implements a Tree backed by a red-black Tree.

Structure is not thread safe.

Reference: http://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package treeset implements a Tree backed by a red-black Tree.

Structure is not thread safe.

Reference: http://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Package treeset implements a Tree backed by a red-black Tree.

Structure is not thread safe.

Reference: http://en.wikipedia.org/wiki/Set_%28abstract_data_type%29

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountDeltaSetIntersection

func AccountDeltaSetIntersection(a *AccountDeltaSet, b *AccountDeltaSet, callback func(elem common.AccountDelta))

func AccountNameSetIntersection

func AccountNameSetIntersection(a *AccountNameSet, b *AccountNameSet, callback func(elem common.AccountName))

func NamePairSetIntersection

func NamePairSetIntersection(a *NamePairSet, b *NamePairSet, callback func(elem common.NamePair))

func PermissionLevelSetIntersection

func PermissionLevelSetIntersection(a *PermissionLevelSet, b *PermissionLevelSet, callback func(elem common.PermissionLevel))

func PublicKeySetIntersection

func PublicKeySetIntersection(a *PublicKeySet, b *PublicKeySet, callback func(elem ecc.PublicKey))

Types

type AccountDeltaSet

type AccountDeltaSet struct {
	*rbt.Tree
}

Set holds elements in a red-black Tree

func CopyFromAccountDeltaSet

func CopyFromAccountDeltaSet(ts *AccountDeltaSet) *AccountDeltaSet

func NewAccountDeltaSet

func NewAccountDeltaSet(Value ...common.AccountDelta) *AccountDeltaSet

func (*AccountDeltaSet) Add

func (set *AccountDeltaSet) Add(items ...common.AccountDelta)

Add adds the items (one or more) to the set.

func (*AccountDeltaSet) AddItem

Add adds the item one to the set.Returns false and the interface if it already exists

func (*AccountDeltaSet) Begin

Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty

func (*AccountDeltaSet) Contains

func (set *AccountDeltaSet) Contains(items ...common.AccountDelta) bool

Contains checks weather items (one or more) are present in the set. All items have to be present in the set for the method to return true. Returns true if no arguments are passed at all, i.e. set is always superset of empty set.

func (*AccountDeltaSet) Each

func (set *AccountDeltaSet) Each(f func(value common.AccountDelta))

Each calls the given function once for each element, passing that element's index and value.

func (*AccountDeltaSet) End

End returns End Iterator

func (*AccountDeltaSet) Find

func (set *AccountDeltaSet) Find(f func(value common.AccountDelta) bool) (v common.AccountDelta)

Find passes each element of the container to the given function and returns the first (index,value) for which the function is true or -1,nil otherwise if no element matches the criteria.

func (*AccountDeltaSet) Iterator

func (set *AccountDeltaSet) Iterator() IteratorAccountDeltaSet

Iterator holding the iterator's state

func (*AccountDeltaSet) LowerBound

func (AccountDeltaSet) MarshalJSON

func (set AccountDeltaSet) MarshalJSON() ([]byte, error)

ToJSON outputs the JSON representation of the set.

func (AccountDeltaSet) Pack

func (set AccountDeltaSet) Pack() (re []byte, err error)

func (*AccountDeltaSet) Remove

func (set *AccountDeltaSet) Remove(items ...common.AccountDelta)

Remove removes the items (one or more) from the set.

func (*AccountDeltaSet) String

func (set *AccountDeltaSet) String() string

String returns a string representation of container

func (*AccountDeltaSet) UnmarshalJSON

func (set *AccountDeltaSet) UnmarshalJSON(data []byte) error

FromJSON populates the set from the input JSON representation.

func (*AccountDeltaSet) Unpack

func (set *AccountDeltaSet) Unpack(in []byte) (int, error)

func (*AccountDeltaSet) UpperBound

func (*AccountDeltaSet) Values

func (set *AccountDeltaSet) Values() []common.AccountDelta

Values returns all items in the set.

type AccountNameSet

type AccountNameSet struct {
	*rbt.Tree
}

Set holds elements in a red-black Tree

func CopyFromAccountNameSet

func CopyFromAccountNameSet(ts *AccountNameSet) *AccountNameSet

func NewAccountNameSet

func NewAccountNameSet(Value ...common.AccountName) *AccountNameSet

func (*AccountNameSet) Add

func (set *AccountNameSet) Add(items ...common.AccountName)

Add adds the items (one or more) to the set.

func (*AccountNameSet) AddItem

func (set *AccountNameSet) AddItem(item common.AccountName) (bool, common.AccountName)

Add adds the item one to the set.Returns false and the interface if it already exists

func (*AccountNameSet) Begin

Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty

func (*AccountNameSet) Contains

func (set *AccountNameSet) Contains(items ...common.AccountName) bool

Contains checks weather items (one or more) are present in the set. All items have to be present in the set for the method to return true. Returns true if no arguments are passed at all, i.e. set is always superset of empty set.

func (*AccountNameSet) Each

func (set *AccountNameSet) Each(f func(value common.AccountName))

Each calls the given function once for each element, passing that element's index and value.

func (*AccountNameSet) End

End returns End Iterator

func (*AccountNameSet) Find

func (set *AccountNameSet) Find(f func(value common.AccountName) bool) (v common.AccountName)

Find passes each element of the container to the given function and returns the first (index,value) for which the function is true or -1,nil otherwise if no element matches the criteria.

func (*AccountNameSet) Iterator

func (set *AccountNameSet) Iterator() IteratorAccountNameSet

Iterator holding the iterator's state

func (*AccountNameSet) LowerBound

func (AccountNameSet) MarshalJSON

func (set AccountNameSet) MarshalJSON() ([]byte, error)

ToJSON outputs the JSON representation of the set.

func (AccountNameSet) Pack

func (set AccountNameSet) Pack() (re []byte, err error)

func (*AccountNameSet) Remove

func (set *AccountNameSet) Remove(items ...common.AccountName)

Remove removes the items (one or more) from the set.

func (*AccountNameSet) String

func (set *AccountNameSet) String() string

String returns a string representation of container

func (*AccountNameSet) UnmarshalJSON

func (set *AccountNameSet) UnmarshalJSON(data []byte) error

FromJSON populates the set from the input JSON representation.

func (*AccountNameSet) Unpack

func (set *AccountNameSet) Unpack(in []byte) (int, error)

func (*AccountNameSet) UpperBound

func (*AccountNameSet) Values

func (set *AccountNameSet) Values() []common.AccountName

Values returns all items in the set.

type AccountNameUint32Map

type AccountNameUint32Map struct {
	*rbt.Tree
}

Map holds the elements in a red-black Tree

func CopyFromAccountNameUint32Map

func CopyFromAccountNameUint32Map(tm *AccountNameUint32Map) *AccountNameUint32Map

func NewAccountNameUint32Map

func NewAccountNameUint32Map() *AccountNameUint32Map

NewWith instantiates a Tree map with the custom comparator.

func (*AccountNameUint32Map) Begin

Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty

func (*AccountNameUint32Map) Each

func (m *AccountNameUint32Map) Each(f func(key common.AccountName, value uint32))

Each calls the given function once for each element, passing that element's key and value.

func (*AccountNameUint32Map) End

End returns End Iterator

func (*AccountNameUint32Map) Find

func (m *AccountNameUint32Map) Find(f func(key common.AccountName, value uint32) bool) (k common.AccountName, v uint32)

Find passes each element of the container to the given function and returns the first (key,value) for which the function is true or nil,nil otherwise if no element matches the criteria.

func (*AccountNameUint32Map) Get

Get searches the element in the map by key and returns its value or nil if key is not found in Tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.

func (*AccountNameUint32Map) Insert

func (*AccountNameUint32Map) Iterator

Iterator returns a stateful Iterator whose elements are key/value pairs.

func (*AccountNameUint32Map) Keys

Keys returns all keys in-order

func (*AccountNameUint32Map) LowerBound

func (AccountNameUint32Map) MarshalJSON

func (m AccountNameUint32Map) MarshalJSON() ([]byte, error)

func (AccountNameUint32Map) Pack

func (m AccountNameUint32Map) Pack() (re []byte, err error)

func (*AccountNameUint32Map) Put

func (m *AccountNameUint32Map) Put(key common.AccountName, value uint32)

Put inserts key-value pair into the map. Key should adhere to the comparator's type assertion, otherwise method panics.

func (*AccountNameUint32Map) Remove

func (m *AccountNameUint32Map) Remove(key common.AccountName)

Remove removes the element from the map by key. Key should adhere to the comparator's type assertion, otherwise method panics.

func (AccountNameUint32Map) String

func (m AccountNameUint32Map) String() string

String returns a string representation of container

func (*AccountNameUint32Map) UnmarshalJSON

func (m *AccountNameUint32Map) UnmarshalJSON(data []byte) error

FromJSON populates the map from the input JSON representation.

func (*AccountNameUint32Map) Unpack

func (m *AccountNameUint32Map) Unpack(in []byte) (int, error)

func (*AccountNameUint32Map) UpperBound

func (*AccountNameUint32Map) Values

func (m *AccountNameUint32Map) Values() []uint32

Values returns all values in-order based on the key.

type AccountNameUint64Map

type AccountNameUint64Map struct {
	*rbt.Tree
}

Map holds the elements in a red-black Tree

func CopyFromAccountNameUint64Map

func CopyFromAccountNameUint64Map(tm *AccountNameUint64Map) *AccountNameUint64Map

func NewAccountNameUint64Map

func NewAccountNameUint64Map() *AccountNameUint64Map

NewWith instantiates a Tree map with the custom comparator.

func (*AccountNameUint64Map) Begin

Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty

func (*AccountNameUint64Map) Each

func (m *AccountNameUint64Map) Each(f func(key common.AccountName, value uint64))

Each calls the given function once for each element, passing that element's key and value.

func (*AccountNameUint64Map) End

End returns End Iterator

func (*AccountNameUint64Map) Find

func (m *AccountNameUint64Map) Find(f func(key common.AccountName, value uint64) bool) (k common.AccountName, v uint64)

Find passes each element of the container to the given function and returns the first (key,value) for which the function is true or nil,nil otherwise if no element matches the criteria.

func (*AccountNameUint64Map) Get

Get searches the element in the map by key and returns its value or nil if key is not found in Tree. Second return parameter is true if key was found, otherwise false. Key should adhere to the comparator's type assertion, otherwise method panics.

func (*AccountNameUint64Map) Insert

func (*AccountNameUint64Map) Iterator

Iterator returns a stateful Iterator whose elements are key/value pairs.

func (*AccountNameUint64Map) Keys

Keys returns all keys in-order

func (*AccountNameUint64Map) LowerBound

func (AccountNameUint64Map) MarshalJSON

func (m AccountNameUint64Map) MarshalJSON() ([]byte, error)

func (AccountNameUint64Map) Pack

func (m AccountNameUint64Map) Pack() (re []byte, err error)

func (*AccountNameUint64Map) Put

func (m *AccountNameUint64Map) Put(key common.AccountName, value uint64)

Put inserts key-value pair into the map. Key should adhere to the comparator's type assertion, otherwise method panics.

func (*AccountNameUint64Map) Remove

func (m *AccountNameUint64Map) Remove(key common.AccountName)

Remove removes the element from the map by key. Key should adhere to the comparator's type assertion, otherwise method panics.

func (AccountNameUint64Map) String

func (m AccountNameUint64Map) String() string

String returns a string representation of container

func (*AccountNameUint64Map) UnmarshalJSON

func (m *AccountNameUint64Map) UnmarshalJSON(data []byte) error

FromJSON populates the map from the input JSON representation.

func (*AccountNameUint64Map) Unpack

func (m *AccountNameUint64Map) Unpack(in []byte) (int, error)

func (*AccountNameUint64Map) UpperBound

func (*AccountNameUint64Map) Values

func (m *AccountNameUint64Map) Values() []uint64

Values returns all values in-order based on the key.

type IteratorAccountDeltaSet

type IteratorAccountDeltaSet struct {
	rbt.Iterator
}

Iterator returns a stateful iterator whose values can be fetched by an index.

func (IteratorAccountDeltaSet) Value

func (iterator IteratorAccountDeltaSet) Value() common.AccountDelta

Value returns the current element's value. Does not modify the state of the iterator.

type IteratorAccountNameSet

type IteratorAccountNameSet struct {
	rbt.Iterator
}

Iterator returns a stateful iterator whose values can be fetched by an index.

func (IteratorAccountNameSet) Value

func (iterator IteratorAccountNameSet) Value() common.AccountName

Value returns the current element's value. Does not modify the state of the iterator.

type IteratorAccountNameUint32Map

type IteratorAccountNameUint32Map struct {
	rbt.Iterator
}

Iterator holding the Iterator's state

func (IteratorAccountNameUint32Map) Key

Key returns the current element's key. Does not modify the state of the Iterator.

func (IteratorAccountNameUint32Map) Value

func (iterator IteratorAccountNameUint32Map) Value() uint32

Value returns the current element's value. Does not modify the state of the Iterator.

type IteratorAccountNameUint64Map

type IteratorAccountNameUint64Map struct {
	rbt.Iterator
}

Iterator holding the Iterator's state

func (IteratorAccountNameUint64Map) Key

Key returns the current element's key. Does not modify the state of the Iterator.

func (IteratorAccountNameUint64Map) Value

func (iterator IteratorAccountNameUint64Map) Value() uint64

Value returns the current element's value. Does not modify the state of the Iterator.

type IteratorNamePairSet

type IteratorNamePairSet struct {
	rbt.Iterator
}

Iterator returns a stateful iterator whose values can be fetched by an index.

func (IteratorNamePairSet) Value

func (iterator IteratorNamePairSet) Value() common.NamePair

Value returns the current element's value. Does not modify the state of the iterator.

type IteratorPermissionLevelSet

type IteratorPermissionLevelSet struct {
	rbt.Iterator
}

Iterator returns a stateful iterator whose values can be fetched by an index.

func (IteratorPermissionLevelSet) Value

Value returns the current element's value. Does not modify the state of the iterator.

type IteratorPublicKeySet

type IteratorPublicKeySet struct {
	rbt.Iterator
}

Iterator returns a stateful iterator whose values can be fetched by an index.

func (IteratorPublicKeySet) Value

func (iterator IteratorPublicKeySet) Value() ecc.PublicKey

Value returns the current element's value. Does not modify the state of the iterator.

type NamePairSet

type NamePairSet struct {
	*rbt.Tree
}

Set holds elements in a red-black Tree

func CopyFromNamePairSet

func CopyFromNamePairSet(ts *NamePairSet) *NamePairSet

func NewNamePairSet

func NewNamePairSet(Value ...common.NamePair) *NamePairSet

func (*NamePairSet) Add

func (set *NamePairSet) Add(items ...common.NamePair)

Add adds the items (one or more) to the set.

func (*NamePairSet) AddItem

func (set *NamePairSet) AddItem(item common.NamePair) (bool, common.NamePair)

Add adds the item one to the set.Returns false and the interface if it already exists

func (*NamePairSet) Begin

func (set *NamePairSet) Begin() IteratorNamePairSet

Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty

func (*NamePairSet) Contains

func (set *NamePairSet) Contains(items ...common.NamePair) bool

Contains checks weather items (one or more) are present in the set. All items have to be present in the set for the method to return true. Returns true if no arguments are passed at all, i.e. set is always superset of empty set.

func (*NamePairSet) Each

func (set *NamePairSet) Each(f func(value common.NamePair))

Each calls the given function once for each element, passing that element's index and value.

func (*NamePairSet) End

func (set *NamePairSet) End() IteratorNamePairSet

End returns End Iterator

func (*NamePairSet) Find

func (set *NamePairSet) Find(f func(value common.NamePair) bool) (v common.NamePair)

Find passes each element of the container to the given function and returns the first (index,value) for which the function is true or -1,nil otherwise if no element matches the criteria.

func (*NamePairSet) Iterator

func (set *NamePairSet) Iterator() IteratorNamePairSet

Iterator holding the iterator's state

func (*NamePairSet) LowerBound

func (set *NamePairSet) LowerBound(item common.NamePair) IteratorNamePairSet

func (NamePairSet) MarshalJSON

func (set NamePairSet) MarshalJSON() ([]byte, error)

ToJSON outputs the JSON representation of the set.

func (NamePairSet) Pack

func (set NamePairSet) Pack() (re []byte, err error)

func (*NamePairSet) Remove

func (set *NamePairSet) Remove(items ...common.NamePair)

Remove removes the items (one or more) from the set.

func (*NamePairSet) String

func (set *NamePairSet) String() string

String returns a string representation of container

func (*NamePairSet) UnmarshalJSON

func (set *NamePairSet) UnmarshalJSON(data []byte) error

FromJSON populates the set from the input JSON representation.

func (*NamePairSet) Unpack

func (set *NamePairSet) Unpack(in []byte) (int, error)

func (*NamePairSet) UpperBound

func (set *NamePairSet) UpperBound(item common.NamePair) IteratorNamePairSet

func (*NamePairSet) Values

func (set *NamePairSet) Values() []common.NamePair

Values returns all items in the set.

type PermissionLevelSet

type PermissionLevelSet struct {
	*rbt.Tree
}

Set holds elements in a red-black Tree

func CopyFromPermissionLevelSet

func CopyFromPermissionLevelSet(ts *PermissionLevelSet) *PermissionLevelSet

func NewPermissionLevelSet

func NewPermissionLevelSet(Value ...common.PermissionLevel) *PermissionLevelSet

func (*PermissionLevelSet) Add

func (set *PermissionLevelSet) Add(items ...common.PermissionLevel)

Add adds the items (one or more) to the set.

func (*PermissionLevelSet) AddItem

Add adds the item one to the set.Returns false and the interface if it already exists

func (*PermissionLevelSet) Begin

Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty

func (*PermissionLevelSet) Contains

func (set *PermissionLevelSet) Contains(items ...common.PermissionLevel) bool

Contains checks weather items (one or more) are present in the set. All items have to be present in the set for the method to return true. Returns true if no arguments are passed at all, i.e. set is always superset of empty set.

func (*PermissionLevelSet) Each

func (set *PermissionLevelSet) Each(f func(value common.PermissionLevel))

Each calls the given function once for each element, passing that element's index and value.

func (*PermissionLevelSet) End

End returns End Iterator

func (*PermissionLevelSet) Find

func (set *PermissionLevelSet) Find(f func(value common.PermissionLevel) bool) (v common.PermissionLevel)

Find passes each element of the container to the given function and returns the first (index,value) for which the function is true or -1,nil otherwise if no element matches the criteria.

func (*PermissionLevelSet) Iterator

Iterator holding the iterator's state

func (*PermissionLevelSet) LowerBound

func (PermissionLevelSet) MarshalJSON

func (set PermissionLevelSet) MarshalJSON() ([]byte, error)

ToJSON outputs the JSON representation of the set.

func (PermissionLevelSet) Pack

func (set PermissionLevelSet) Pack() (re []byte, err error)

func (*PermissionLevelSet) Remove

func (set *PermissionLevelSet) Remove(items ...common.PermissionLevel)

Remove removes the items (one or more) from the set.

func (*PermissionLevelSet) String

func (set *PermissionLevelSet) String() string

String returns a string representation of container

func (*PermissionLevelSet) UnmarshalJSON

func (set *PermissionLevelSet) UnmarshalJSON(data []byte) error

FromJSON populates the set from the input JSON representation.

func (*PermissionLevelSet) Unpack

func (set *PermissionLevelSet) Unpack(in []byte) (int, error)

func (*PermissionLevelSet) UpperBound

func (*PermissionLevelSet) Values

func (set *PermissionLevelSet) Values() []common.PermissionLevel

Values returns all items in the set.

type PublicKeySet

type PublicKeySet struct {
	*rbt.Tree
}

Set holds elements in a red-black Tree

func CopyFromPublicKeySet

func CopyFromPublicKeySet(ts *PublicKeySet) *PublicKeySet

func NewPublicKeySet

func NewPublicKeySet(Value ...ecc.PublicKey) *PublicKeySet

func (*PublicKeySet) Add

func (set *PublicKeySet) Add(items ...ecc.PublicKey)

Add adds the items (one or more) to the set.

func (*PublicKeySet) AddItem

func (set *PublicKeySet) AddItem(item ecc.PublicKey) (bool, ecc.PublicKey)

Add adds the item one to the set.Returns false and the interface if it already exists

func (*PublicKeySet) Begin

func (set *PublicKeySet) Begin() IteratorPublicKeySet

Begin returns First Iterator whose position points to the first element Return End Iterator when the map is empty

func (*PublicKeySet) Contains

func (set *PublicKeySet) Contains(items ...ecc.PublicKey) bool

Contains checks weather items (one or more) are present in the set. All items have to be present in the set for the method to return true. Returns true if no arguments are passed at all, i.e. set is always superset of empty set.

func (*PublicKeySet) Each

func (set *PublicKeySet) Each(f func(value ecc.PublicKey))

Each calls the given function once for each element, passing that element's index and value.

func (*PublicKeySet) End

End returns End Iterator

func (*PublicKeySet) Find

func (set *PublicKeySet) Find(f func(value ecc.PublicKey) bool) (v ecc.PublicKey)

Find passes each element of the container to the given function and returns the first (index,value) for which the function is true or -1,nil otherwise if no element matches the criteria.

func (*PublicKeySet) Iterator

func (set *PublicKeySet) Iterator() IteratorPublicKeySet

Iterator holding the iterator's state

func (*PublicKeySet) LowerBound

func (set *PublicKeySet) LowerBound(item ecc.PublicKey) IteratorPublicKeySet

func (PublicKeySet) MarshalJSON

func (set PublicKeySet) MarshalJSON() ([]byte, error)

ToJSON outputs the JSON representation of the set.

func (PublicKeySet) Pack

func (set PublicKeySet) Pack() (re []byte, err error)

func (*PublicKeySet) Remove

func (set *PublicKeySet) Remove(items ...ecc.PublicKey)

Remove removes the items (one or more) from the set.

func (*PublicKeySet) String

func (set *PublicKeySet) String() string

String returns a string representation of container

func (*PublicKeySet) UnmarshalJSON

func (set *PublicKeySet) UnmarshalJSON(data []byte) error

FromJSON populates the set from the input JSON representation.

func (*PublicKeySet) Unpack

func (set *PublicKeySet) Unpack(in []byte) (int, error)

func (*PublicKeySet) UpperBound

func (set *PublicKeySet) UpperBound(item ecc.PublicKey) IteratorPublicKeySet

func (*PublicKeySet) Values

func (set *PublicKeySet) Values() []ecc.PublicKey

Values returns all items in the set.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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