I am implementing a binary tree. I created an Iterator class for the tree that implements iterator but i must give it the tree for the constructor:

```
    public class AvlIterator implements Iterable<Integer>{
    public Iterator<Integer> iterator(AvlTree avlTree){
    //here i construct the iterator class, with the avlTree inside.
    }
}

```

But the interface doesn't get any object in its constructor. It tells me to add this signature:

```
    public Iterator<Integer> iterator();

```

So what is wrong with my implementation? On one hand i need the tree object for doing my operations, on the other hand Java is "Telling me" that i am not doing things properly.