|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.python.core.AbstractArray org.python.core.PyObjectArray
Provides mutable behavior on a PyObject array. Supports operations for
implementing java.util.List
.
Constructor Summary | |
PyObjectArray()
Create the array with the specified size. |
|
PyObjectArray(int size)
Create the array with the specified size. |
|
PyObjectArray(PyObject[] rawArray)
|
|
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. |
java.lang.Object |
clone()
Duplicates the object with the generic call. |
void |
ensureCapacity(int minCapacity)
|
boolean |
equals(java.lang.Object o)
|
PyObject |
get(int index)
Retrieve the value present at an index position in the array. |
java.lang.Object |
getArray()
Get the backing array. |
int |
hashCode()
|
void |
remove(int start,
int stop)
Removes a range from the array at the specified indices. |
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. |
Methods inherited from class org.python.core.AbstractArray |
appendArray, clear, copyArray, getModCountIncr, getSize, remove, replaceSubArray, replaceSubArray, setSize, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public PyObjectArray()
public PyObjectArray(PyObject[] rawArray)
public PyObjectArray(int size)
size
- number of int values initially allowed in arraypublic PyObjectArray(PyObjectArray toCopy)
toCopy
- Method Detail |
public void remove(int start, int stop)
AbstractArray
remove
in class AbstractArray
start
- inclusivestop
- exclusivepublic void add(int index, PyObject value)
AbstractList
subclasses should update their
modCount
after calling this method.
index
- index position at which to insert elementvalue
- value to be inserted into arraypublic int add(PyObject value)
AbstractList
subclasses should update their
modCount
after calling this method.
value
- value to be added
public java.lang.Object clone()
public boolean equals(java.lang.Object o)
public int hashCode()
public PyObject get(int index)
index
- index position for value to be retrieved
public java.lang.Object getArray()
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()
.
public PyObject set(int index, PyObject value)
index
- index position to be setvalue
- value to be setpublic PyObject[] toArray()
getSize()
public void ensureCapacity(int minCapacity)
minCapacity
- new minimum size required
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |