Code example for Set

Methods: iterator

    public PySetIterator(Set set) {
        this._set = set;
        this._count = 0;
        this._iterator = set.iterator();
    public PyObject __iter__() { 
        return this;
     * Returns the next item in the iteration or raises a StopIteration. 
     * <p/> 
     * <p/> 
     * This differs from the core Jython Set iterator in that it checks if 
     * the underlying Set changes in size during the course and upon completion 
     * of the iteration.  A RuntimeError is raised if the Set ever changes size 
     * or is concurrently modified. 
     * </p>