Top Inners Fields Constructors Methods
org.python.modules.itertools

public Class PyTeeIterator

extends PyIterator
Class Inheritance
Known Direct Subclasses
org.python.modules.itertools.PyTeeIteratorDerived
Annotations
@ExposedType
name:itertools.tee
base:PyObject
isBaseType:false
doc:Iterator wrapped to make it copyable
Imports
java.util.Map, org.python.core.Py, .PyException, .PyIterator, .PyNewWrapper, .PyObject, .PyType, .Visitproc, org.python.expose.ExposedMethod, .ExposedNew, .ExposedType, org.python.util.Generic

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private int
public static final String
private PyTeeIterator.PyTeeData
Inherited from org.python.core.PyIterator:
__doc__nextstopException

Constructor Summary

AccessConstructor and Description
public
public
public

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.

private static PyTeeIterator
public static PyObject[]
makeTees(PyObject iterable, int n)

public boolean
public final PyTeeIterator
pack-priv static final PyObject
tee___new__(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)

public final PyObject
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

positionback to summary
private int position
tee_docback to summary
public static final String tee_doc
teeDataback to summary
private PyTeeIterator.PyTeeData teeData

Constructor Detail

PyTeeIteratorback to summary
public PyTeeIterator()
PyTeeIteratorback to summary
public PyTeeIterator(PyType subType)
PyTeeIteratorback to summary
public PyTeeIterator(PyTeeIterator.PyTeeData teeData)

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.

fromIterableback to summary
private static PyTeeIterator fromIterable(PyObject iterable)
makeTeesback to summary
public static PyObject[] makeTees(PyObject iterable, int n)
refersDirectlyToback to summary
public boolean refersDirectlyTo(PyObject ob) throws UnsupportedOperationException

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
tee___copy__back to summary
public final PyTeeIterator tee___copy__()
Annotations
@ExposedMethod
tee___new__back to summary
pack-priv static final PyObject tee___new__(PyNewWrapper new_, boolean init, PyType subtype, PyObject[] args, String[] keywords)
Annotations
@ExposedNew
tee_nextback to summary
public final PyObject tee_next()
Annotations
@ExposedMethod
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
org.python.modules.itertools back to summary

private Class PyTeeIterator.PyTeeData

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private Map<Integer, PyObject>
private PyObject
private Object
public PyException
private int

Constructor Summary

AccessConstructor and Description
public
PyTeeData(PyObject iterator)

Method Summary

Modifier and TypeMethod and Description
public PyObject
getItem(int pos)

private PyObject
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bufferback to summary
private Map<Integer, PyObject> buffer
iteratorback to summary
private PyObject iterator
lockback to summary
private Object lock
stopExceptionback to summary
public PyException stopException
totalback to summary
private int total

Constructor Detail

PyTeeDataback to summary
public PyTeeData(PyObject iterator)

Method Detail

getItemback to summary
public PyObject getItem(int pos)
nextElementback to summary
private PyObject nextElement(PyObject pyIter)