This, I'm not sure. As far as I know, this is an implementation of an iterator design pattern .
However, we can say that it uses the State Pattern , since the next() call affects the state of the Iterator . But IMO, this is not an implementation of the State Pattern , since it does not change the underlying object on which the operation should be performed. Wikipedia has a great example of a Java State Template .
source share