diff --git a/priority_queuekey/iterator.go b/priority_queuekey/iterator.go index 95f5473..2174357 100644 --- a/priority_queuekey/iterator.go +++ b/priority_queuekey/iterator.go @@ -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 } diff --git a/tree/avlkey/iterator.go b/tree/avlkey/iterator.go index 3110331..943fa05 100644 --- a/tree/avlkey/iterator.go +++ b/tree/avlkey/iterator.go @@ -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 } diff --git a/tree/avlkeydup/iterator.go b/tree/avlkeydup/iterator.go index a95658e..3c897b0 100644 --- a/tree/avlkeydup/iterator.go +++ b/tree/avlkeydup/iterator.go @@ -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 } diff --git a/tree/vbtkey/iterator.go b/tree/vbtkey/iterator.go index 8444c5e..556eb4a 100644 --- a/tree/vbtkey/iterator.go +++ b/tree/vbtkey/iterator.go @@ -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 }