Top Description Fields Constructors Methods
org.python.core

public Class PyReversedIterator

extends PyIterator
Class Inheritance

An iterator that yields the objects from a sequence-like object in reverse order.

Field Summary

Modifier and TypeField and Description
private int
private PyObject
Inherited from org.python.core.PyIterator:
__doc__nextstopException

Constructor Summary

AccessConstructor and Description
public
PyReversedIterator(PyObject
- an object that supports __getitem__ and __len__
seq
)

Creates an iterator that first yields the item at __len__ - 1 on seq and returns the objects in descending order from there down to 0.

Method Summary

Modifier and TypeMethod and Description
public PyObject
__iternext__()

Implements abstract org.python.core.PyIterator.__iternext__.

Return the next element of the sequence that this is an iterator for.

public boolean
public int
traverse(Visitproc visit, Object arg)

Overrides org.python.core.PyIterator.traverse.

Implements org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects.

Inherited from org.python.core.PyIterator:
__iter____tojava__doNextiteratornext

Field Detail

idxback to summary
private int idx
seqback to summary
private PyObject seq

Constructor Detail

PyReversedIteratorback to summary
public PyReversedIterator(PyObject seq)

Creates an iterator that first yields the item at __len__ - 1 on seq and returns the objects in descending order from there down to 0.

Parameters
seq:PyObject

- an object that supports __getitem__ and __len__

Method Detail

__iternext__back to summary
public PyObject __iternext__()

Implements abstract org.python.core.PyIterator.__iternext__.

Doc from org.python.core.PyObject.__iternext__.

Return the next element of the sequence that this is an iterator for. Returns null when the end of the sequence is reached.

refersDirectlyToback to summary
public boolean refersDirectlyTo(PyObject ob)

Overrides org.python.core.PyIterator.refersDirectlyTo.

Implements org.python.core.Traverseproc.refersDirectlyTo.

Doc from org.python.core.Traverseproc.refersDirectlyTo.

Optional operation. Should only be implemented if it is more efficient than calling traverse(Visitproc, Object) with a visitproc that just watches out for ob. Must return false if ob is null.

Annotations
@Override
traverseback to summary
public int traverse(Visitproc visit, Object arg)

Overrides org.python.core.PyIterator.traverse.

Implements org.python.core.Traverseproc.traverse.

Doc from org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects. Like in CPython, arg must be passed unmodified to visit as its second parameter. If Visitproc#visit(PyObject, Object) returns nonzero, this return value must be returned immediately by traverse. Visitproc#visit(PyObject, Object) must not be called with a null PyObject-argument.

Annotations
@Override