ListIterator now implements next and current command (e.g it.next)
This commit is contained in:
parent
06373f5126
commit
2a2840bdf2
@ -90,16 +90,20 @@ func (it *ListIterator) TypeName() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (it *ListIterator) HasOperation(name string) bool {
|
func (it *ListIterator) HasOperation(name string) bool {
|
||||||
yes := name == resetName || name == indexName || name == countName
|
yes := name == nextName || name == resetName || name == indexName || name == countName || name == currentName
|
||||||
return yes
|
return yes
|
||||||
}
|
}
|
||||||
|
|
||||||
func (it *ListIterator) CallOperation(name string, args []any) (v any, err error) {
|
func (it *ListIterator) CallOperation(name string, args []any) (v any, err error) {
|
||||||
switch name {
|
switch name {
|
||||||
|
case nextName:
|
||||||
|
v, err = it.Next()
|
||||||
case resetName:
|
case resetName:
|
||||||
v, err = it.Reset()
|
v, err = it.Reset()
|
||||||
case indexName:
|
case indexName:
|
||||||
v = int64(it.Index())
|
v = int64(it.Index())
|
||||||
|
case currentName:
|
||||||
|
v, err = it.Current()
|
||||||
case countName:
|
case countName:
|
||||||
v = it.count
|
v = it.count
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user