Cleaned up the (ChildIterator -> Parent) interface

This commit is contained in:
Sasha Koshka 2023-03-04 01:05:37 -05:00
parent 1d9fb6024d
commit 56e11ae1de

View File

@ -6,11 +6,9 @@ import "git.tebibyte.media/sashakoshka/tomo/theme"
import "git.tebibyte.media/sashakoshka/tomo/config" import "git.tebibyte.media/sashakoshka/tomo/config"
import "git.tebibyte.media/sashakoshka/tomo/elements" import "git.tebibyte.media/sashakoshka/tomo/elements"
// ChildIterator represents an object that can iterate over a list of children, // Parent represents an object that can provide access to a list of child
// calling a specified iterator function for each one. When keepGoing is false, // elements.
// the iterator stops the current loop and OverChildren returns. type Parent interface {
type ChildIterator interface {
OverChildren (func (child elements.Element) (keepGoing bool))
Child (index int) elements.Element Child (index int) elements.Element
CountChildren () int CountChildren () int
} }