Top Fields Constructors Methods
org.python.modules.itertools

public Class repeat

extends PyIterator
Class Inheritance
Known Direct Subclasses
org.python.modules.itertools.repeatDerived
Annotations
@ExposedType
name:itertools.repeat
base:PyObject
doc:\'repeat(element [,times]) -> create an iterator which returns the element for the specified number of times. If not specified, returns the element endlessly.
Imports
org.python.core.ArgParser, .Py, .PyIterator, .PyObject, .PyString, .PyTuple, .PyType, .Visitproc, org.python.expose.ExposedMethod, .ExposedNew, .ExposedType

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
public
repeat(PyType subType)

public
repeat(PyObject object)

public
repeat(PyObject object, int times)

Method Summary

Modifier and TypeMethod and Description
pack-priv final PyObject
public PyObject
__iternext__()

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

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

public int
__len__()

Overrides org.python.core.PyObject.__len__.

Equivalent to the standard Python __len__ method.

public PyString
__repr__()

Overrides org.python.core.PyObject.__repr__.

Equivalent to the standard Python __repr__ method.

public PyObject
next()

Overrides org.python.core.PyIterator.next.

The exposed next method.

public boolean
pack-priv final void
repeat___init__(final PyObject[] args, String[] kwds)

private void
repeat___init__(final PyObject object, final int times)

Creates an iterator that returns the same object the number of times given by times.

private void
repeat___init__(final PyObject object)

Creates an iterator that returns the same object over and over again.

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__doNextiterator

Field Detail

counterback to summary
private int counter
iterback to summary
private PyIterator iter
objectback to summary
private PyObject object
repeat_docback to summary
public static final String repeat_doc
TYPEback to summary
public static final PyType TYPE

Hides org.python.core.PyObject.TYPE.

Constructor Detail

repeatback to summary
public repeat()
repeatback to summary
public repeat(PyType subType)
repeatback to summary
public repeat(PyObject object)
repeatback to summary
public repeat(PyObject object, int times)

Method Detail

__copy__back to summary
pack-priv final PyObject __copy__()
Annotations
@ExposedMethod
__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.

__len__back to summary
public int __len__()

Overrides org.python.core.PyObject.__len__.

Doc from org.python.core.PyObject.__len__.

Equivalent to the standard Python __len__ method. Part of the mapping discipline.

Returns:int

the length of the object

Annotations
@ExposedMethod

__repr__back to summary
public PyString __repr__()

Overrides org.python.core.PyObject.__repr__.

Doc from org.python.core.PyObject.__repr__.

Equivalent to the standard Python __repr__ method. Each sub-class of PyObject is likely to re-define this method to provide for its own reproduction.

Annotations
@ExposedMethod
nextback to summary
public PyObject next()

Overrides org.python.core.PyIterator.next.

Doc from org.python.core.PyIterator.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.

Returns:PyObject

a PyObject result

Annotations
@ExposedMethod
@Override

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
repeat___init__back to summary
pack-priv final void repeat___init__(final PyObject[] args, String[] kwds)
Annotations
@ExposedNew
@ExposedMethod
repeat___init__back to summary
private void repeat___init__(final PyObject object, final int times)

Creates an iterator that returns the same object the number of times given by times.

repeat___init__back to summary
private void repeat___init__(final PyObject object)

Creates an iterator that returns the same object over and over again.

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