Documentation ¶
Index ¶
- type Element
- type OrderedMap
- func (orderedMap *OrderedMap) Clear()
- func (orderedMap *OrderedMap) Delete(key interface{}) bool
- func (orderedMap *OrderedMap) ForEach(consumer func(key, value interface{}) bool) bool
- func (orderedMap *OrderedMap) ForEachReverse(consumer func(key, value interface{}) bool) bool
- func (orderedMap *OrderedMap) Get(key interface{}) (interface{}, bool)
- func (orderedMap *OrderedMap) Has(key interface{}) (has bool)
- func (orderedMap *OrderedMap) Head() (key, value interface{}, exists bool)
- func (orderedMap *OrderedMap) Initialize()
- func (orderedMap *OrderedMap) Set(key interface{}, newValue interface{}) bool
- func (orderedMap *OrderedMap) Size() int
- func (orderedMap *OrderedMap) Tail() (key, value interface{}, exists bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Element ¶
type Element struct {
// contains filtered or unexported fields
}
Element defines the model of each element of the orderedMap.
type OrderedMap ¶
type OrderedMap struct {
// contains filtered or unexported fields
}
OrderedMap provides a concurrent-safe ordered map.
func (*OrderedMap) Clear ¶
func (orderedMap *OrderedMap) Clear()
Clear removes all elements from the OrderedMap.
func (*OrderedMap) Delete ¶
func (orderedMap *OrderedMap) Delete(key interface{}) bool
Delete deletes the given key (and related value) from the orderedMap. It returns false if the key is not found.
func (*OrderedMap) ForEach ¶
func (orderedMap *OrderedMap) ForEach(consumer func(key, value interface{}) bool) bool
ForEach iterates through the orderedMap and calls the consumer function for every element. The iteration can be aborted by returning false in the consumer.
func (*OrderedMap) ForEachReverse ¶
func (orderedMap *OrderedMap) ForEachReverse(consumer func(key, value interface{}) bool) bool
ForEachReverse iterates through the orderedMap in reverse order and calls the consumer function for every element. The iteration can be aborted by returning false in the consumer.
func (*OrderedMap) Get ¶
func (orderedMap *OrderedMap) Get(key interface{}) (interface{}, bool)
Get returns the value mapped to the given key if exists.
func (*OrderedMap) Has ¶
func (orderedMap *OrderedMap) Has(key interface{}) (has bool)
Has returns if an entry with the given key exists.
func (*OrderedMap) Head ¶
func (orderedMap *OrderedMap) Head() (key, value interface{}, exists bool)
Head returns the first map entry.
func (*OrderedMap) Initialize ¶
func (orderedMap *OrderedMap) Initialize()
Initialize returns the first map entry.
func (*OrderedMap) Set ¶
func (orderedMap *OrderedMap) Set(key interface{}, newValue interface{}) bool
Set adds a key-value pair to the orderedMap. It returns false if the same pair already exists.
func (*OrderedMap) Size ¶
func (orderedMap *OrderedMap) Size() int
Size returns the size of the orderedMap.
func (*OrderedMap) Tail ¶
func (orderedMap *OrderedMap) Tail() (key, value interface{}, exists bool)
Tail returns the last map entry.