From 52be8fb21b6a911e1ed430943665705a33b418cc Mon Sep 17 00:00:00 2001 From: Matei Chiperi Date: Thu, 2 Oct 2014 16:34:17 -0700 Subject: [PATCH] Updated Except operator to the new operator interface. --- graph/iterator/not_iterator.go | 39 ++++++++++++++------------------------- 1 file changed, 14 insertions(+), 25 deletions(-) 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, + } +}