| java.lang.Object org.python.core.AbstractArray org.python.core.PyObjectArray
PyObjectArray | public class PyObjectArray extends AbstractArray (Code) | | Provides mutable behavior on a PyObject array. Supports operations for
implementing java.util.List .
author: Clark Updike |
Field Summary | |
protected PyObject[] | baseArray The underlying array used for storing the data. |
Method Summary | |
public void | add(int index, PyObject value) Add a value at a specified index in the array. | public int | add(PyObject value) Add a value to the array, appending it after the current values. | public Object | clone() Duplicates the object with the generic call. | protected void | discardValues(int from, int to) Discards values for a range of indices from the array. | public void | ensureCapacity(int minCapacity) | public boolean | equals(Object o) | public PyObject | get(int index) Retrieve the value present at an index position in the array. | public Object | getArray() Get the backing array. | public int | hashCode() | public void | remove(int start, int stop) | public PyObject | set(int index, PyObject value) Set the value at an index position in the array. | protected void | setArray(Object array) Set the backing array. | public PyObject[] | toArray() Constructs and returns a simple array containing the same data as held
in this growable array. |
baseArray | protected PyObject[] baseArray(Code) | | The underlying array used for storing the data.
|
PyObjectArray | public PyObjectArray()(Code) | | Create the array with the specified size.
|
PyObjectArray | public PyObjectArray(int size)(Code) | | Create the array with the specified size.
Parameters: size - number of int values initially allowed in array |
add | public void add(int index, PyObject value)(Code) | | Add a value at a specified index in the array.
AbstractList subclasses should update their
modCount after calling this method.
Parameters: index - index position at which to insert element Parameters: value - value to be inserted into array
|
add | public int add(PyObject value)(Code) | | Add a value to the array, appending it after the current values.
AbstractList subclasses should update their
modCount after calling this method.
Parameters: value - value to be added index number of added element
|
clone | public Object clone()(Code) | | Duplicates the object with the generic call.
a copy of the object |
discardValues | protected void discardValues(int from, int to)(Code) | | Discards values for a range of indices from the array. For the array of
int values, just sets the values to null.
Parameters: from - index of first value to be discarded Parameters: to - index past last value to be discarded |
ensureCapacity | public void ensureCapacity(int minCapacity)(Code) | | |
get | public PyObject get(int index)(Code) | | Retrieve the value present at an index position in the array.
Parameters: index - index position for value to be retrieved value from position in the array |
getArray | public Object getArray()(Code) | | Get the backing array. This method is used by the type-agnostic base
class code to access the array used for type-specific storage. The array
should generally not be modified. To get a copy of the array, see
PyObjectArray.toArray() which returns a copy. Note that
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() .
backing array object |
hashCode | public int hashCode()(Code) | | |
remove | public void remove(int start, int stop)(Code) | | |
set | public PyObject set(int index, PyObject value)(Code) | | Set the value at an index position in the array.
Parameters: index - index position to be set Parameters: value - value to be set |
setArray | protected void setArray(Object array)(Code) | | Set the backing array. This method is used by the type-agnostic base
class code to set the array used for type-specific storage.
Parameters: array - the backing array object |
toArray | public PyObject[] toArray()(Code) | | Constructs and returns a simple array containing the same data as held
in this growable array. The array's length matches the value returned
by getSize()
array containing a copy of the data |
|
|