slice object.
| Modifier and Type | Class and Description |
|---|---|
| public class | PySlice.Indices
An object that presents the |
| Modifier and Type | Field and Description |
|---|---|
| private final Object | |
| private final Object | |
| private final Object | |
| pack-priv static final PyType | TYPE
The type of Python object this class implements. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | PySlice(int
index of first item in slice. start, int index of first item not in slice. stop)Create a Python |
| Modifier and Type | Method and Description |
|---|---|
| private Object | |
| private Object | |
| pack-priv final Object | |
| private Object | |
| private Object | Returns: result of comparison orNotImplementedmust be a slice or return o, Comparison op)NotImplementedInvoke the comparison specified (supports |
| pack-priv PySlice. | Returns: anIndices from this slice and the lengthof the sequence length)Calculate the actual indices of this slice in relation to a
sequence of length |
| pack-priv final Object |
| start | back to summary |
|---|---|
| private final Object start
| |
| step | back to summary |
|---|---|
| private final Object step
| |
| stop | back to summary |
|---|---|
| private final Object stop
| |
| TYPE | back to summary |
|---|---|
| pack-priv static final PyType TYPE The type of Python object this class implements. | |
| PySlice | back to summary |
|---|---|
| public PySlice(Object start, Object stop, Object step) Create a Python | |
| PySlice | back to summary |
|---|---|
| public PySlice(Object start, Object stop) Create a Python | |
| PySlice | back to summary |
|---|---|
| public PySlice(int start, int stop) Create a Python
| |
| __eq__ | back to summary |
|---|---|
private Object __eq__(Object o) throws Throwable
| |
| __ne__ | back to summary |
|---|---|
private Object __ne__(Object o) throws Throwable
| |
| __reduce__ | back to summary |
|---|---|
| pack-priv final Object __reduce__() | |
| __repr__ | back to summary |
|---|---|
private Object __repr__()
| |
| compare | back to summary |
|---|---|
| private Object compare(Object o, Comparison op) throws Throwable Invoke the comparison specified (supports
result of comparison or
| |
| getIndices | back to summary |
|---|---|
| pack-priv PySlice. Calculate the actual indices of this slice in relation to a
sequence of length | |
| indices | back to summary |
|---|---|
| pack-priv final Object indices(Object length) throws Throwable | |
start, stop and
step data members from this slice object as Java
ints in an immutable data object, adjusted to a specific
length of a notional source sequence (see
Indices#Indices(int)).
End-relative addressing (as in a[-3:-1]) and None
indices (as in a[:]) have been translated in construction
to absolute indices a client may use without further range
checks.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private static final int | |
| public final int | slicelength
The number of elements to select from the source sequence, and therefore the length of the slice to be generated. |
| public final int | start
Absolute index in the source sequence of the first element to be taken by the slice. |
| public final int | step
The index step to make when selecting elements from the source sequence. |
| public final int | stop
Absolute index relative to the source sequence that is the image
of |
| Access | Constructor and Description |
|---|---|
| public | Indices(int
of the target sequence length)Extract the |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| MAX | back to summary |
|---|---|
| private static final int MAX | |
| MIN | back to summary |
|---|---|
| private static final int MIN | |
| slicelength | back to summary |
|---|---|
| public final int slicelength The number of elements to select from the source sequence, and therefore the length of the slice to be generated. | |
| start | back to summary |
|---|---|
| public final int start Absolute index in the source sequence of the first element to be
taken by the slice. If | |
| step | back to summary |
|---|---|
| public final int step The index step to make when selecting elements from the source sequence. Never zero. | |
| stop | back to summary |
|---|---|
| public final int stop Absolute index relative to the source sequence that is the image
of | |
| Indices | back to summary |
|---|---|
| public Indices(int length) throws TypeError, ValueError, Throwable Extract the Out of bounds indices are clipped in a manner consistent with the handling of normal slices. The idiom:
Indices x = slice.new Indices(a.length);
for (int k=0; k<x.slicelength; k++) {
f(a[x.start + k*x.step]);
}
will access only in in-range elements.
Detail: Before adjusting to the specific sequence length,
the following occurs. Extract the
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |