Enumerate iterator types

This commit is contained in:
kortschak 2014-07-03 09:57:31 +09:30
parent 1f67913ed9
commit cd46452b63
23 changed files with 145 additions and 68 deletions

View file

@ -101,12 +101,18 @@ func (it *Iterator) DebugString(indent int) string {
return fmt.Sprintf("%s(%s tags:%s size:%d %s)", strings.Repeat(" ", indent), it.Type(), it.Tags(), size, it.data)
}
func (it *Iterator) Type() string {
return "llrb"
}
func (it *Iterator) Sorted() bool {
return true
var memType graph.Type
func init() {
memType = graph.Register("llrb")
}
func Type() graph.Type { return memType }
func (it *Iterator) Type() graph.Type { return memType }
func (it *Iterator) Sorted() bool { return true }
func (it *Iterator) Optimize() (graph.Iterator, bool) {
return it, false
}