diff --git a/graph/iterator/not_iterator.go b/graph/iterator/not_iterator.go index 08a2542..db394f8 100644 --- a/graph/iterator/not_iterator.go +++ b/graph/iterator/not_iterator.go @@ -1,9 +1,6 @@ package iterator import ( - "fmt" - "strings" - "github.com/google/cayley/graph" ) @@ -76,28 +73,6 @@ func (it *Not) ResultTree() *graph.ResultTree { return tree } -// DebugString prints information about the iterator. -func (it *Not) DebugString(indent int) string { - var tags string - for _, k := range it.tags.Tags() { - tags += fmt.Sprintf("%s;", k) - } - - spaces := strings.Repeat(" ", indent+2) - return fmt.Sprintf("%s(%s %d\n%stags:%v\n%sprimary_it:\n%s\n%sall_it:\n%s\n%s)", - strings.Repeat(" ", indent), - it.Type(), - it.UID(), - spaces, - it.tags.Tags(), - spaces, - it.primaryIt.DebugString(indent+4), - spaces, - it.allIt.DebugString(indent+4), - strings.Repeat(" ", indent), - ) -} - // Next advances the Not iterator. It returns whether there is another valid // new value. It fetches the next value of the all iterator which is not // contained by the primary iterator. @@ -172,3 +147,17 @@ func (it *Not) Stats() graph.IteratorStats { func (it *Not) Size() (int64, bool) { return it.Stats().Size, false } + +func (it *Not) Describe() graph.Description { + subIts := []graph.Description{ + it.primaryIt.Describe(), + it.allIt.Describe(), + } + + return graph.Description{ + UID: it.UID(), + Type: it.Type(), + Tags: it.tags.Tags(), + Iterators: subIts, + } +}