| Modifier and Type | Field and Description |
|---|---|
| public static PyString | |
| protected PyException |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public PyObject | __iter__()
Overrides org. Return an iterator that is used to iterate the element of this sequence. |
| public abstract PyObject | __iternext__()
Overrides org. Return the next element of the sequence that this is an iterator for. |
| public Object | __tojava__(Class<?>
the Class to convert this c)PyObject to.Overrides org. Equivalent to the Jython __tojava__ method. |
| protected final PyObject | |
| public Iterator | |
| public PyObject | |
| public boolean | refersDirectlyTo(PyObject ob)
Implements org. Optional operation. |
| public int | traverse(Visitproc visit, Object arg)
Implements org. Traverses all directly contained |
| __doc__next | back to summary |
|---|---|
| public static PyString __doc__next | |
| stopException | back to summary |
|---|---|
| protected PyException stopException | |
| PyIterator | back to summary |
|---|---|
| public PyIterator() | |
| PyIterator | back to summary |
|---|---|
| public PyIterator(PyType subType) | |
| __iter__ | back to summary |
|---|---|
| public PyObject __iter__() Overrides org. Doc from org. Return an iterator that is used to iterate the element of this sequence. From version 2.2, this method is the primary protocol for looping over sequences. If a PyObject subclass should support iteration based in the __finditem__() method, it must supply an implementation of __iter__() like this:
public PyObject __iter__() {
return new PySequenceIter(this);
}
When iterating over a python sequence from java code, it should be done with code like
this:
for (PyObject item : seq.asIterable()) {
// Do something with item
}
| |
| __iternext__ | back to summary |
|---|---|
| public abstract PyObject __iternext__() Overrides org. Doc from org. Return the next element of the sequence that this is an iterator for. Returns null when the end of the sequence is reached. | |
| __tojava__ | back to summary |
|---|---|
| public Object __tojava__(Class<?> c) Overrides org. Doc from org. Equivalent to the Jython __tojava__ method. Tries to coerce this object to an instance of the
requested Java class. Returns the special object | |
| doNext | back to summary |
|---|---|
| protected final PyObject doNext(PyObject ret) | |
| iterator | back to summary |
|---|---|
| public Iterator Implements java. Doc from java. Returns an iterator over elements of type | |
| next | back to summary |
|---|---|
| public PyObject next() The exposed next method. Note that exposed derivable subclasses of PyIterator should override next to call doNext(custom___iternext__), as __iternext__ is overridden by the Derived classes.
| |
| refersDirectlyTo | back to summary |
|---|---|
| public boolean refersDirectlyTo(PyObject ob) Implements org. Doc from org. Optional operation.
Should only be implemented if it is more efficient
than calling
| |
| traverse | back to summary |
|---|---|
| public int traverse(Visitproc visit, Object arg) Implements org. Doc from org. Traverses all directly contained
| |