| Modifier and Type | Class and Description |
|---|---|
| protected class | PySequence.
Class defining the default behaviour of sequences with respect to slice assignment, etc.,
which is the one correct for |
| Modifier and Type | Field and Description |
|---|---|
| protected SequenceIndexDelegate | delegator
A delegate that handles index checking and manipulation for get, set and del operations on this sequence in the form of a "pluggable behaviour". |
| Access | Constructor and Description |
|---|---|
| protected | PySequence(PyType
actual (Python) type of sub-class type)Construct a PySequence for the given sub-type with the default index behaviour. |
| protected | PySequence(PyType
actual (Python) type of sub-class type, SequenceIndexDelegate specific index behaviour (or null) behaviour)Construct a PySequence for the given sub-type with custom index behaviour. |
| Modifier and Type | Method and Description |
|---|---|
| public void | __delitem__(PyObject
the key to be removed from the container index)Overrides org. Equivalent to the standard Python __delitem__ method. |
| public void | __delslice__(PyObject start, PyObject stop, PyObject step)
Overrides org.
|
| public PyObject | __eq__(PyObject
the object to compare this with. o)Overrides org. Equivalent to the standard Python __eq__ method. |
| public PyObject | __finditem__(int
the key to lookup in this sequence. index)Overrides org. A variant of the __finditem__ method which accepts a primitive |
| public PyObject | __finditem__(PyObject
the key to lookup in this container index)Overrides org. Very similar to the standard Python __getitem__ method. |
| public PyObject | __ge__(PyObject
the object to compare this with. o)Overrides org. Equivalent to the standard Python __ge__ method. |
| public PyObject | __getitem__(PyObject
the key to lookup in this container. index)Overrides org. Equivalent to the standard Python __getitem__ method. |
| public PyObject | __getslice__(PyObject start, PyObject stop, PyObject step)
Overrides org.
|
| public PyObject | __gt__(PyObject
the object to compare this with. o)Overrides org. Equivalent to the standard Python __gt__ method. |
| public PyObject | __iter__()
Overrides org. Return an iterator that is used to iterate the element of this sequence. |
| public PyObject | __le__(PyObject
the object to compare this with. o)Overrides org. Equivalent to the standard Python __le__ method. |
| public PyObject | __lt__(PyObject
the object to compare this with. o)Overrides org. Equivalent to the standard Python __lt__ method. |
| public PyObject | __ne__(PyObject
the object to compare this with. o)Overrides org. Equivalent to the standard Python __ne__ method. |
| public boolean | __nonzero__()
Overrides org. Equivalent to the standard Python __nonzero__ method. |
| public void | __setitem__(int
the key whose value will be set index, PyObject the value to set this key to value)Overrides org. A variant of the __setitem__ method which accepts a primitive |
| public void | __setitem__(PyObject
the key whose value will be set index, PyObject the value to set this key to value)Overrides org. Equivalent to the standard Python __setitem__ method. |
| public void | __setslice__(PyObject start, PyObject stop, PyObject step, PyObject value)
Overrides org.
|
| public synchronized Object | __tojava__(Class<?>
the Class to convert this c)PyObject to.Overrides org. Equivalent to the Jython __tojava__ method. |
| protected int | |
| protected static int | Returns: value ≥ 0 is the index where the sequences differs. -1: reached the end of o1 without a difference -2: reached the end of both sequences without a difference -3: reached the end of o2 without a differenceCompare the specified object/length pairs. |
| protected void | del(int
index of the element to delete. index)Deletes an element from the sequence (and closes up the gap). |
| protected void | delRange(int
the position of the first element. start, int one more than the position of the last element. stop)Deletes a contiguous sub-sequence (and closes up the gap). |
| protected void | delslice(int
the position of the first element. start, int beyond the position of the last element (not necessarily just beyond). stop, int from one element to the next (positive or negative) step, int number of elements to delete n)Deletes a simple or extended slice and closes up the gap(s). |
| protected static PySequence | fastSequence(PyObject seq, String msg)
Return a copy of a sequence where the __len__() method is telling the truth. |
| protected abstract PyObject | Returns: a sequence corresponding the the given range of elements.the position of the first element. start, int one more than the position of the last element. stop, int the step size. step)Returns a range of elements from the sequence. |
| public boolean | |
| public boolean | |
| public boolean | |
| protected boolean | |
| protected abstract PyObject | Returns: the element at the given position in the list.index of element to return. index)Returns the element of the sequence at the given index. |
| protected void | |
| protected abstract PyObject | Returns: this sequence repeated count times.the number of times to repeat the sequence. count)Returns a (concrete subclass of) PySequence that repeats the given sequence, as in the
implementation of |
| protected String | runsupportedopMessage(String op, PyObject o2)
Overrides org. Return sequence-specific error messages suitable for substitution. |
| pack-priv final void | |
| pack-priv final void | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final boolean | |
| pack-priv final void | |
| pack-priv final void | |
| protected void | |
| protected static final int | sliceLength(int start, int stop, long step)
Make step a long in case adding the start, stop and step together overflows an int. |
| protected String | unsupportedopMessage(String op, PyObject o2)
Overrides org. Return sequence-specific error messages suitable for substitution. |
| delegator | back to summary |
|---|---|
| protected SequenceIndexDelegate delegator A delegate that handles index checking and manipulation for get, set and del operations on
this sequence in the form of a "pluggable behaviour". Because different types of sequence
exhibit subtly different behaviour, there is scope for subclasses to customise the behaviour
with their own extension of | |
| PySequence | back to summary |
|---|---|
| protected PySequence(PyType type) Construct a PySequence for the given sub-type with the default index behaviour.
| |
| PySequence | back to summary |
|---|---|
| protected PySequence(PyType type, SequenceIndexDelegate behaviour) Construct a PySequence for the given sub-type with custom index behaviour. In practice, restrictions on the construction of inner classes will mean null has to be passed and the actual delegator assigned later.
| |
| __delitem__ | back to summary |
|---|---|
| public void __delitem__(PyObject index) Overrides org. Doc from org. Equivalent to the standard Python __delitem__ method. | |
| __delslice__ | back to summary |
|---|---|
| public void __delslice__(PyObject start, PyObject stop, PyObject step) Overrides org.
| |
| __eq__ | back to summary |
|---|---|
| public PyObject __eq__(PyObject o) Overrides org. Doc from org. Equivalent to the standard Python __eq__ method. | |
| __finditem__ | back to summary |
|---|---|
| public PyObject __finditem__(int index) Overrides org. Doc from org. A variant of the __finditem__ method which accepts a primitive | |
| __finditem__ | back to summary |
|---|---|
| public PyObject __finditem__(PyObject index) Overrides org. Doc from org. Very similar to the standard Python __getitem__ method. Instead of throwing a KeyError if the item isn't found, this just returns null. Classes that wish to implement __getitem__ should override this method instead (with the appropriate semantics. | |
| __ge__ | back to summary |
|---|---|
| public PyObject __ge__(PyObject o) Overrides org. Doc from org. Equivalent to the standard Python __ge__ method. | |
| __getitem__ | back to summary |
|---|---|
| public PyObject __getitem__(PyObject index) Overrides org. Doc from org. Equivalent to the standard Python __getitem__ method. This method should not be overridden.
Override the | |
| __getslice__ | back to summary |
|---|---|
| public PyObject __getslice__(PyObject start, PyObject stop, PyObject step) Overrides org.
| |
| __gt__ | back to summary |
|---|---|
| public PyObject __gt__(PyObject o) Overrides org. Doc from org. Equivalent to the standard Python __gt__ method. | |
| __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
}
| |
| __le__ | back to summary |
|---|---|
| public PyObject __le__(PyObject o) Overrides org. Doc from org. Equivalent to the standard Python __le__ method. | |
| __lt__ | back to summary |
|---|---|
| public PyObject __lt__(PyObject o) Overrides org. Doc from org. Equivalent to the standard Python __lt__ method. | |
| __ne__ | back to summary |
|---|---|
| public PyObject __ne__(PyObject o) Overrides org. Doc from org. Equivalent to the standard Python __ne__ method. | |
| __nonzero__ | back to summary |
|---|---|
| public boolean __nonzero__() Overrides org. Doc from org. Equivalent to the standard Python __nonzero__ method. Returns whether of not a given
| |
| __setitem__ | back to summary |
|---|---|
| public void __setitem__(int index, PyObject value) Overrides org. Doc from org. A variant of the __setitem__ method which accepts a primitive
| |
| __setitem__ | back to summary |
|---|---|
| public void __setitem__(PyObject index, PyObject value) Overrides org. Doc from org. Equivalent to the standard Python __setitem__ method. | |
| __setslice__ | back to summary |
|---|---|
| public void __setslice__(PyObject start, PyObject stop, PyObject step, PyObject value) Overrides org.
| |
| __tojava__ | back to summary |
|---|---|
| public synchronized Object __tojava__(Class<?> c) throws PyIgnoreMethodTag 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 | |
| boundToSequence | back to summary |
|---|---|
| protected int boundToSequence(int index) Adjusts | |
| cmp | back to summary |
|---|---|
| protected static int cmp(PyObject o1, int ol1, PyObject o2, int ol2) Compare the specified object/length pairs.
| |
| del | back to summary |
|---|---|
| protected void del(int index) Deletes an element from the sequence (and closes up the gap).
| |
| delRange | back to summary |
|---|---|
| protected void delRange(int start, int stop) Deletes a contiguous sub-sequence (and closes up the gap).
| |
| delslice | back to summary |
|---|---|
| protected void delslice(int start, int stop, int step, int n) Deletes a simple or extended slice and closes up the gap(s). The slice parameters
| |
| fastSequence | back to summary |
|---|---|
| protected static PySequence fastSequence(PyObject seq, String msg) Return a copy of a sequence where the __len__() method is telling the truth. | |
| getslice | back to summary |
|---|---|
| protected abstract PyObject getslice(int start, int stop, int step) Returns a range of elements from the sequence.
a sequence corresponding the the given range of elements. | |
| isMappingType | back to summary |
|---|---|
| public boolean isMappingType() throws PyIgnoreMethodTag Overrides org.
| |
| isNumberType | back to summary |
|---|---|
| public boolean isNumberType() throws PyIgnoreMethodTag Overrides org.
| |
| isSequenceType | back to summary |
|---|---|
| public boolean isSequenceType() Overrides org.
| |
| isSubType | back to summary |
|---|---|
| protected boolean isSubType(PyObject other) isSubType tailored for PySequence binops.
| |
| pyget | back to summary |
|---|---|
| protected abstract PyObject pyget(int index) Returns the element of the sequence at the given index. This is an extension point called by
PySequence in its implementation of
| |
| pyset | back to summary |
|---|---|
| protected void pyset(int index, PyObject value) Sets the indexed element of the sequence to the given value. This is an extension point
called by PySequence in its implementation of
| |
| repeat | back to summary |
|---|---|
| protected abstract PyObject repeat(int count) Returns a (concrete subclass of) PySequence that repeats the given sequence, as in the
implementation of
| |
| runsupportedopMessage | back to summary |
|---|---|
| protected String runsupportedopMessage(String op, PyObject o2) Overrides org. Return sequence-specific error messages suitable for substitution. {0} is the op name. {1} is the left operand type. {2} is the right operand type.
| |
| seq___delitem__ | back to summary |
|---|---|
| pack-priv final void seq___delitem__(PyObject index) | |
| seq___delslice__ | back to summary |
|---|---|
| pack-priv final void seq___delslice__(PyObject start, PyObject stop, PyObject step) | |
| seq___eq__ | back to summary |
|---|---|
| pack-priv final PyObject seq___eq__(PyObject o) | |
| seq___finditem__ | back to summary |
|---|---|
| pack-priv final PyObject seq___finditem__(int index) | |
| seq___finditem__ | back to summary |
|---|---|
| pack-priv final PyObject seq___finditem__(PyObject index) | |
| seq___ge__ | back to summary |
|---|---|
| pack-priv final PyObject seq___ge__(PyObject o) | |
| seq___getitem__ | back to summary |
|---|---|
| pack-priv final PyObject seq___getitem__(PyObject index) | |
| seq___getslice__ | back to summary |
|---|---|
| pack-priv final PyObject seq___getslice__(PyObject start, PyObject stop, PyObject step) | |
| seq___gt__ | back to summary |
|---|---|
| pack-priv final PyObject seq___gt__(PyObject o) | |
| seq___iter__ | back to summary |
|---|---|
| pack-priv final PyObject seq___iter__() | |
| seq___le__ | back to summary |
|---|---|
| pack-priv final PyObject seq___le__(PyObject o) | |
| seq___lt__ | back to summary |
|---|---|
| pack-priv final PyObject seq___lt__(PyObject o) | |
| seq___ne__ | back to summary |
|---|---|
| pack-priv final PyObject seq___ne__(PyObject o) | |
| seq___nonzero__ | back to summary |
|---|---|
| pack-priv final boolean seq___nonzero__() | |
| seq___setitem__ | back to summary |
|---|---|
| pack-priv final void seq___setitem__(PyObject index, PyObject value) | |
| seq___setslice__ | back to summary |
|---|---|
| pack-priv final void seq___setslice__(PyObject start, PyObject stop, PyObject step, PyObject value) | |
| setslice | back to summary |
|---|---|
| protected void setslice(int start, int stop, int step, PyObject value) Sets the given range of elements according to Python slice assignment semantics. If the step
size is one, it is a simple slice and the operation is equivalent to deleting that slice,
then inserting the value at that position, regarding the value as a sequence (if possible) or
as a single element if it is not a sequence. If the step size is not one, but
| |
| sliceLength | back to summary |
|---|---|
| protected static final int sliceLength(int start, int stop, long step) Make step a long in case adding the start, stop and step together overflows an int. | |
| unsupportedopMessage | back to summary |
|---|---|
| protected String unsupportedopMessage(String op, PyObject o2) Overrides org. Return sequence-specific error messages suitable for substitution. {0} is the op name. {1} is the left operand type. {2} is the right operand type.
| |
list.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public PyObject | |
| public PyObject | getSlice(int start, int stop, int step)
Implements abstract org.
|
| public String | |
| public int | |
| public void | |
| public void | setSlice(int start, int stop, int step, PyObject value)
Implements abstract org.
|
| DefaultIndexDelegate | back to summary |
|---|---|
| protected DefaultIndexDelegate() | |
| delItem | back to summary |
|---|---|
| public void delItem(int idx) Implements abstract org.
| |
| delItems | back to summary |
|---|---|
| public void delItems(int start, int stop) Implements abstract org.
| |
| getItem | back to summary |
|---|---|
| public PyObject getItem(int idx) Implements abstract org.
| |
| getSlice | back to summary |
|---|---|
| public PyObject getSlice(int start, int stop, int step) Implements abstract org.
| |
| getTypeName | back to summary |
|---|---|
| public String getTypeName() Implements abstract org.
| |
| len | back to summary |
|---|---|
| public int len() Implements abstract org.
| |
| setItem | back to summary |
|---|---|
| public void setItem(int idx, PyObject value) Implements abstract org.
| |
| setSlice | back to summary |
|---|---|
| public void setSlice(int start, int stop, int step, PyObject value) Implements abstract org.
| |