Documentation
¶
Index ¶
Constants ¶
View Source
const ( LessThan = -1 + iota EqualTo GreaterThan )
Variables ¶
This section is empty.
Functions ¶
func OrderedCompare ¶
func OrderedEqual ¶
func OrderedLess ¶
Types ¶
type Compare ¶
Compare compares e with self, if a is less than b, returns LessThan if a is greater than b, returns GreaterThan if a is equal to b, returns EqualTo
type Container ¶
type Container[T any] interface { // Values returns all the values of the container Values() []T // Size returns the size of the container elements Size() int // Clear clears all the elements of the container Clear() // String returns the string representation of the container String() string }
Container is the base interface represent of all data structures
type IndexIterable ¶
type IndexIterable[V any] interface { Iterator() IndexIterator[V] }
IndexIterable is the base interface of all data structures that can be iterated over by slice index
type IndexIterator ¶
IndexIterator is base interface of iterator which use slice index
type Iterator ¶
type Iterator[K any, V any] interface { // Rewind set the iterator index to the initial state Rewind() // Reverse changes the iterator orientation Reverse() // Valid returns true if the iterator has not reaches the end Valid() bool // Next move the index to the next element Next() // Index returns iterator current index Index() K // Value returns value of iterator current index Value() V // SeekTo move current index to the given index, returns true if success, or returns false SeekTo(index K) bool }
Iterator is the base interface of the all data structures iterators iterator is readonly, represents of data snapshot at a certain moment
Click to show internal directories.
Click to hide internal directories.