Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Walker ¶
type Walker struct {
// contains filtered or unexported fields
}
Walker implements a generic data structure that simplifies walks over collections or data structures.
func New ¶
New is the constructor of the Walker. It accepts an optional boolean flag that controls whether the Walker will visit the same Element multiple times.
func (*Walker) HasNext ¶
HasNext returns true if the Walker has another element that shall be visited.
func (*Walker) Next ¶
func (w *Walker) Next() (nextElement interface{})
Next returns the next element of the walk.
func (*Walker) Push ¶
Push adds a new element to the walk, which can consequently be retrieved by calling the Next method.
func (*Walker) StopWalk ¶
func (w *Walker) StopWalk()
StopWalk aborts the walk and forces HasNext to always return false.
func (*Walker) WalkStopped ¶
WalkStopped returns true if the Walk has been stopped.
Click to show internal directories.
Click to hide internal directories.