iter-list.go: implemented the Typer interface
This commit is contained in:
parent
fe5c8e9619
commit
0170baa0f5
@ -85,6 +85,10 @@ func (it *ListIterator) String() string {
|
|||||||
return fmt.Sprintf("$(#%d)", l)
|
return fmt.Sprintf("$(#%d)", l)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (it *ListIterator) TypeName() string {
|
||||||
|
return "ListIterator"
|
||||||
|
}
|
||||||
|
|
||||||
func (it *ListIterator) HasOperation(name string) bool {
|
func (it *ListIterator) HasOperation(name string) bool {
|
||||||
yes := name == resetName || name == indexName || name == countName
|
yes := name == resetName || name == indexName || name == countName
|
||||||
return yes
|
return yes
|
||||||
|
@ -22,6 +22,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Iterator interface {
|
type Iterator interface {
|
||||||
|
Typer
|
||||||
Next() (item any, err error) // must return io.EOF after the last item
|
Next() (item any, err error) // must return io.EOF after the last item
|
||||||
Current() (item any, err error)
|
Current() (item any, err error)
|
||||||
Index() int
|
Index() int
|
||||||
|
Loading…
Reference in New Issue
Block a user