add iterator Key() function
This commit is contained in:
parent
edd2e84792
commit
adb2651169
|
@ -1,7 +1,7 @@
|
|||
package pqueuekey
|
||||
|
||||
import (
|
||||
"github.com/474420502/focus/stack/listarraystack"
|
||||
lastack "github.com/474420502/focus/stack/listarraystack"
|
||||
)
|
||||
|
||||
type Iterator struct {
|
||||
|
@ -50,6 +50,10 @@ func (iter *Iterator) SetNode(n *Node) {
|
|||
iter.tstack.Clear()
|
||||
}
|
||||
|
||||
func (iter *Iterator) Key() interface{} {
|
||||
return iter.cur.key
|
||||
}
|
||||
|
||||
func (iter *Iterator) Value() interface{} {
|
||||
return iter.cur.value
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package avlkey
|
||||
|
||||
import (
|
||||
"github.com/474420502/focus/stack/listarraystack"
|
||||
lastack "github.com/474420502/focus/stack/listarraystack"
|
||||
)
|
||||
|
||||
type Iterator struct {
|
||||
|
@ -50,6 +50,10 @@ func (iter *Iterator) SetNode(n *Node) {
|
|||
iter.tstack.Clear()
|
||||
}
|
||||
|
||||
func (iter *Iterator) Key() interface{} {
|
||||
return iter.cur.key
|
||||
}
|
||||
|
||||
func (iter *Iterator) Value() interface{} {
|
||||
return iter.cur.value
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package avlkeydup
|
||||
|
||||
import (
|
||||
"github.com/474420502/focus/stack/listarraystack"
|
||||
lastack "github.com/474420502/focus/stack/listarraystack"
|
||||
)
|
||||
|
||||
type Iterator struct {
|
||||
|
@ -50,6 +50,10 @@ func (iter *Iterator) SetNode(n *Node) {
|
|||
iter.tstack.Clear()
|
||||
}
|
||||
|
||||
func (iter *Iterator) Key() interface{} {
|
||||
return iter.cur.key
|
||||
}
|
||||
|
||||
func (iter *Iterator) Value() interface{} {
|
||||
return iter.cur.value
|
||||
}
|
||||
|
|
|
@ -50,6 +50,10 @@ func (iter *Iterator) SetNode(n *Node) {
|
|||
iter.tstack.Clear()
|
||||
}
|
||||
|
||||
func (iter *Iterator) Key() interface{} {
|
||||
return iter.cur.key
|
||||
}
|
||||
|
||||
func (iter *Iterator) Value() interface{} {
|
||||
return iter.cur.value
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user