Top Fields Constructors Methods
org.python.core

public Class AstList

extends PySequence
implements Cloneable, List, Traverseproc
Class Inheritance
All Implemented Interfaces
org.python.core.Traverseproc, java.util.List, java.util.SequencedCollection, java.util.Collection, java.lang.Iterable, java.lang.Cloneable
Annotations
@ExposedType
name:_ast.astlist
base:PyList
Imports
java.util.ArrayList, .Collection, .Collections, .Iterator, .List, .ListIterator, org.python.antlr.adapter.AstAdapter, org.python.expose.ExposedGet, .ExposedMethod, .ExposedType, .MethodType

Field Summary

Modifier and TypeField and Description
private AstAdapter
private List<E>
data

The underlying Java List.

private static final PyString[]
public static final PyType
Inherited from org.python.core.PySequence:
delegator

Constructor Summary

AccessConstructor and Description
public
public
AstList(List<E> data)

public
AstList(List<E> data, AstAdapter adapter)

public
AstList(PyType type, List<E> data, AstAdapter adapter)

Method Summary

Modifier and TypeMethod and Description
public PyObject
__add__(PyObject
the object to perform this binary operation with (the right-hand operand).
other
)

Overrides org.python.core.PyObject.__add__.

Equivalent to the standard Python __add__ method.

public PyObject
__iadd__(PyObject
the object to perform this binary operation with (the right-hand operand).
other
)

Overrides org.python.core.PyObject.__iadd__.

Equivalent to the standard Python __iadd__ method.

public PyObject
__imul__(PyObject
the object to perform this binary operation with (the right-hand operand).
o
)

Overrides org.python.core.PyObject.__imul__.

Equivalent to the standard Python __imul__ method.

public int
__len__()

Overrides org.python.core.PyObject.__len__.

Equivalent to the standard Python __len__ method.

public PyObject
__mul__(PyObject
the object to perform this binary operation with (the right-hand operand).
o
)

Overrides org.python.core.PyObject.__mul__.

Equivalent to the standard Python __mul__ method.

public PyObject
__radd__(PyObject
the object to perform this binary operation with (the left-hand operand).
o
)

Overrides org.python.core.PyObject.__radd__.

Equivalent to the standard Python __radd__ method.

public PyObject
__rmul__(PyObject
the object to perform this binary operation with (the left-hand operand).
o
)

Overrides org.python.core.PyObject.__rmul__.

Equivalent to the standard Python __rmul__ method.

public Object
__tojava__(Class<T>
the Class to convert this PyObject to.
c
)

Overrides org.python.core.PySequence.__tojava__.

Equivalent to the Jython __tojava__ method.

private int
_index(PyObject o, String message, int start, int stop)

public void
add(int
index at which the specified element is to be inserted
index
,
Object
element to be inserted
element
)

Implements java.util.List.add.

Inserts the specified element at the specified position in this list (optional operation).

public boolean
add(Object
element to be appended to this list
o
)

Implements java.util.List.add.

Appends the specified element to the end of this list (optional operation).

public boolean
addAll(int
index at which to insert the first element from the specified collection
index
,
Collection<E>
collection containing elements to be added to this list
c
)

Implements java.util.List.addAll.

Inserts all of the elements in the specified collection into this list at the specified position (optional operation).

public boolean
addAll(Collection<E>
collection containing elements to be added to this list
c
)

Implements java.util.List.addAll.

Appends all of the elements in the specified collection to the end of this list, in the order that they are returned by the specified collection's iterator (optional operation).

public void
pack-priv final PyObject
pack-priv final boolean
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
public PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final PyObject
pack-priv final boolean
pack-priv final PyObject
pack-priv final PyObject
pack-priv final void
pack-priv final void
pack-priv final void
pack-priv final int
pack-priv final void
pack-priv final int
pack-priv final int
astlist_index(PyObject o, int start, int stop)

pack-priv final int
astlist_index(PyObject o, int start)

pack-priv final int
pack-priv final void
astlist_insert(int index, PyObject o)

pack-priv final PyObject
astlist_pop(int n)

pack-priv final void
pack-priv final void
pack-priv final String
public void
clear()

Implements java.util.List.clear.

Removes all of the elements from this list (optional operation).

public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.

public boolean
contains(Object
element whose presence in this list is to be tested
o
)

Implements java.util.List.contains.

Returns true if this list contains the specified element.

public boolean
containsAll(Collection<E>
collection to be checked for containment in this list
c
)

Implements java.util.List.containsAll.

Returns true if this list contains all of the elements of the specified collection.

public int
count(PyObject value)

protected void
del(int
index of the element to delete.
i
)

Overrides org.python.core.PySequence.del.

Deletes an element from the sequence (and closes up the gap).

protected void
delRange(int start, int stop, int step)

public void
extend(PyObject iterable)

public Object
get(int
index of the element to return
index
)

Implements java.util.List.get.

Returns the element at the specified position in this list.

public PyString[]
protected PyObject
getslice(int
the position of the first element.
start
,
int
one more than the position of the last element.
stop
,
int
the step size.
step
)

Implements abstract org.python.core.PySequence.getslice.

Returns a range of elements from the sequence.

public int
public int
index(PyObject o, int start)

public int
index(PyObject o, int start, int stop)

public int
indexOf(Object
element to search for
o
)

Implements java.util.List.indexOf.

Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.

public void
insert(int index, PyObject o)

public boolean
isEmpty()

Implements java.util.List.isEmpty.

Returns true if this list contains no elements.

public Iterator<E>
iterator()

Implements java.util.List.iterator.

Returns an iterator over the elements in this list in proper sequence.

public int
lastIndexOf(Object
element to search for
o
)

Implements java.util.List.lastIndexOf.

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

public ListIterator<E>
listIterator()

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence).

public ListIterator<E>
listIterator(int
index of the first element to be returned from the list iterator (by a call to next)
index
)

Implements java.util.List.listIterator.

Returns a list iterator over the elements in this list (in proper sequence), starting at the specified position in the list.

public PyObject
pop()

public PyObject
pop(int n)

public boolean
public void
pyadd(int index, PyObject element)

public PyObject
pyget(int
index of element to return.
index
)

Implements abstract org.python.core.PySequence.pyget.

Returns the element of the sequence at the given index.

public void
pyset(int
index of the element to set.
index
,
PyObject
the value to set this element to.
element
)

Overrides org.python.core.PySequence.pyset.

Sets the indexed element of the sequence to the given value.

public boolean
public void
public Object
remove(int
the index of the element to be removed
index
)

Implements java.util.List.remove.

Removes the element at the specified position in this list (optional operation).

public boolean
remove(Object
element to be removed from this list, if present
o
)

Implements java.util.List.remove.

Removes the first occurrence of the specified element from this list, if it is present (optional operation).

public boolean
removeAll(Collection<E>
collection containing elements to be removed from this list
c
)

Implements java.util.List.removeAll.

Removes from this list all of its elements that are contained in the specified collection (optional operation).

protected PyObject
repeat(int
the number of times to repeat the sequence.
count
)

Implements abstract org.python.core.PySequence.repeat.

Returns a (concrete subclass of) PySequence that repeats the given sequence, as in the implementation of __mul__ for strings.

public boolean
retainAll(Collection<E>
collection containing elements to be retained in this list
c
)

Implements java.util.List.retainAll.

Retains only the elements in this list that are contained in the specified collection (optional operation).

public void
public Object
set(int
index of the element to replace
index
,
Object
element to be stored at the specified position
element
)

Implements java.util.List.set.

Replaces the element at the specified position in this list with the specified element (optional operation).

protected void
setslice(int
the position of the first element.
start
,
int
one more than the position of the last element.
stop
,
int
the step size.
step
,
PyObject
an object consistent with the slice assignment
value
)

Overrides org.python.core.PySequence.setslice.

Sets the given range of elements according to Python slice assignment semantics.

protected void
setsliceIterable(int start, int stop, int step, PyObject value)

protected void
setsliceList(int start, int stop, int step, List<E> value)

protected void
setslicePySequence(int start, int stop, int step, PySequence value)

public int
size()

Implements java.util.List.size.

Returns the number of elements in this list.

public List<E>
subList(int
low endpoint (inclusive) of the subList
fromIndex
,
int
high endpoint (exclusive) of the subList
toIndex
)

Implements java.util.List.subList.

Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.

public Object[]
toArray()

Implements java.util.List.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

public Object[]
toArray(Object[]
the array into which the elements of this list are to be stored, if it is big enough; otherwise, a new array of the same runtime type is allocated for this purpose.
a
)

Implements java.util.List.toArray.

Returns an array containing all of the elements in this list in proper sequence (from first to last element); the runtime type of the returned array is that of the specified array.

public String
toString()

Overrides org.python.core.PyObject.toString.

Returns a string representation of the object.

public int
traverse(Visitproc visit, Object arg)

Implements org.python.core.Traverseproc.traverse.

Traverses all directly contained PyObjects.

Inherited from org.python.core.PySequence:
__delitem____delslice____eq____finditem____finditem____ge____getitem____getslice____gt____iter____le____lt____ne____nonzero____setitem____setitem____setslice__boundToSequencecmpdelRangedelslicefastSequenceisMappingTypeisNumberTypeisSequenceTypeisSubTyperunsupportedopMessageseq___delitem__seq___delslice__seq___eq__seq___finditem__seq___finditem__seq___ge__seq___getitem__seq___getslice__seq___gt__seq___iter__seq___le__seq___lt__seq___ne__seq___nonzero__seq___setitem__seq___setslice__sliceLengthunsupportedopMessage