Code example for Iterator

Methods: hasNext, next

0
     * 
     * @return the next item in the iteration 
     *         or null to signal the end of the iteration 
     */ 
    public PyObject __iternext__() { 
        if (this._iterator.hasNext()) {
            this._count++;
            try { 
                return Py.java2py(this._iterator.next());
            } catch (ConcurrentModificationException e) {
                throw Py.RuntimeError("dictionary changed size during iteration"); 
            } 
        } 
        return null; 
    } 
}