|
|
|
@ -64,12 +64,20 @@ type IteratorWithKey interface {
|
|
|
|
|
|
|
|
|
|
// ReverseIteratorWithIndex is stateful iterator for ordered containers whose values can be fetched by an index.
|
|
|
|
|
//
|
|
|
|
|
// Essentially it is the same as IteratorWithIndex, but provides additional Prev() function to enable traversal in reverse.
|
|
|
|
|
// Essentially it is the same as IteratorWithIndex, but provides additional:
|
|
|
|
|
//
|
|
|
|
|
// Prev() function to enable traversal in reverse
|
|
|
|
|
//
|
|
|
|
|
// Last() function to move the iterator to the last element.
|
|
|
|
|
type ReverseIteratorWithIndex interface {
|
|
|
|
|
// Prev moves the iterator to the previous element and returns true if there was a previous element in the container.
|
|
|
|
|
// If Prev() returns true, then previous element's index and value can be retrieved by Index() and Value().
|
|
|
|
|
// Modifies the state of the iterator.
|
|
|
|
|
Prev() bool
|
|
|
|
|
// Last moves the iterator to the last element and returns true if there was a last element in the container.
|
|
|
|
|
// If Last() returns true, then last element's index and value can be retrieved by Index() and Value().
|
|
|
|
|
// Modifies the state of the iterator.
|
|
|
|
|
Last() bool
|
|
|
|
|
|
|
|
|
|
IteratorWithIndex
|
|
|
|
|
// Next() bool
|
|
|
|
@ -79,12 +87,20 @@ type ReverseIteratorWithIndex interface {
|
|
|
|
|
|
|
|
|
|
// ReverseIteratorWithKey is a stateful iterator for ordered containers whose elements are key value pairs.
|
|
|
|
|
//
|
|
|
|
|
// Essentially it is the same as IteratorWithKey, but provides additional Prev() function to enable traversal in reverse.
|
|
|
|
|
// Essentially it is the same as IteratorWithKey, but provides additional:
|
|
|
|
|
//
|
|
|
|
|
// Prev() function to enable traversal in reverse
|
|
|
|
|
//
|
|
|
|
|
// Last() function to move the iterator to the last element.
|
|
|
|
|
type ReverseIteratorWithKey interface {
|
|
|
|
|
// Prev moves the iterator to the previous element and returns true if there was a previous element in the container.
|
|
|
|
|
// If Prev() returns true, then previous element's index and value can be retrieved by Key() and Value().
|
|
|
|
|
// Modifies the state of the iterator.
|
|
|
|
|
Prev() bool
|
|
|
|
|
// Last moves the iterator to the last element and returns true if there was a last element in the container.
|
|
|
|
|
// If Last() returns true, then last element's index and value can be retrieved by Key() and Value().
|
|
|
|
|
// Modifies the state of the iterator.
|
|
|
|
|
Last() bool
|
|
|
|
|
|
|
|
|
|
IteratorWithKey
|
|
|
|
|
// Next() bool
|
|
|
|
|