Top Fields Constructors Methods
org.python.modules.itertools

public Class islice

extends PyIterator
Class Inheritance
Known Direct Subclasses
org.python.modules.itertools.isliceDerived
Annotations
@ExposedType
name:itertools.islice
base:PyObject
doc:islice(iterable, [start,] stop [, step]) --> islice object Return an iterator whose next() method returns selected values from an iterable. If start is specified, will skip all preceding elements; otherwise, start defaults to zero. Step defaults to one. If specified as another value, step determines how many values are skipped between successive calls. Works like a slice() on a list but returns an iterator.
Imports
org.python.core.ArgParser, .Py, .PyInteger, .PyIterator, .PyNone, .PyObject, .PyType, .Visitproc, org.python.expose.ExposedMethod, .ExposedNew, .ExposedType

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
public
islice(PyType subType)

public
islice(PyObject iterable, PyObject stopObj)

public
islice(PyObject iterable, PyObject start, PyObject stopObj)

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.

pack-priv final void
private void
islice___init__(final PyObject iterable, PyObject
the index of where in the iterable to start returning values
startObj
,
PyObject
the index of where in the iterable to stop returning values
stopObj
,
PyObject
the number of steps to take between each call to next()
stepObj
)

Creates an iterator that returns selected values from an iterable.

public PyObject
next()

Overrides org.python.core.PyIterator.next.

The exposed next method.

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__doNextiterator

Field Detail

islice_docback to summary
public static final String islice_doc
iterback to summary
private itertools.ItertoolsIterator iter
TYPEback to summary
public static final PyType TYPE

Hides org.python.core.PyObject.TYPE.

Constructor Detail

isliceback to summary
public islice()
isliceback to summary
public islice(PyType subType)
isliceback to summary
public islice(PyObject iterable, PyObject stopObj)
See Also
startObj defaults to 0 and stepObj to 1
isliceback to summary
public islice(PyObject iterable, PyObject start, PyObject stopObj)
See Also
stepObj defaults to 1

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.

islice___init__back to summary
pack-priv final void islice___init__(PyObject[] args, String[] kwds)
Annotations
@ExposedNew
@ExposedMethod
islice___init__back to summary
private void islice___init__(final PyObject iterable, PyObject startObj, PyObject stopObj, PyObject stepObj)

Creates an iterator that returns selected values from an iterable.

Parameters
startObj:PyObject

the index of where in the iterable to start returning values

stopObj:PyObject

the index of where in the iterable to stop returning values

stepObj:PyObject

the number of steps to take between each call to next()

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
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