org.python.core
public class PyObjectArray extends AbstractArray
java.util.List
.
Constructor Summary | |
---|---|
PyObjectArray()
Create the array with the specified size. | |
PyObjectArray(PyObject[] rawArray) | |
PyObjectArray(int size)
Create the array with the specified size. | |
PyObjectArray(PyObjectArray toCopy) |
Method Summary | |
---|---|
void | add(int index, PyObject value)
Add a value at a specified index in the array.
|
int | add(PyObject value)
Add a value to the array, appending it after the current values.
|
Object | clone()
Duplicates the object with the generic call.
|
void | ensureCapacity(int minCapacity) |
boolean | equals(Object o) |
PyObject | get(int index)
Retrieve the value present at an index position in the array.
|
Object | getArray()
Get the backing array. |
int | hashCode() |
void | remove(int start, int stop) |
PyObject | set(int index, PyObject value)
Set the value at an index position in the array.
|
PyObject[] | toArray()
Constructs and returns a simple array containing the same data as held
in this growable array. |
Parameters: size number of int values initially allowed in array
Parameters: toCopy
AbstractList
subclasses should update their
modCount
after calling this method.
Parameters: index index position at which to insert element value value to be inserted into array
AbstractList
subclasses should update their
modCount
after calling this method.
Parameters: value value to be added
Returns: index number of added element
Returns: a copy of the object
Parameters: index index position for value to be retrieved
Returns: value from position in the array
getSize()
should be used to determine the number of elements
in the array, not the array's length (which may reflect excess capacity).
toArray()
returns an array whose length equals the value
returned by getSize()
.
Returns: backing array object
Parameters: index index position to be set value value to be set
getSize()
Returns: array containing a copy of the data