org.python.core
Class PySequenceList

java.lang.Object
  extended byorg.python.core.PyObject
      extended byorg.python.core.PySequence
          extended byorg.python.core.PySequenceList
All Implemented Interfaces:
java.util.Collection, java.util.List, java.io.Serializable
Direct Known Subclasses:
PyList, PyTuple

public abstract class PySequenceList
extends PySequence
implements java.util.List

Author:
updikca1 To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class org.python.core.PyObject
PyObject.ConversionException
 
Field Summary
 
Fields inherited from class org.python.core.PyObject
exposed_name
 
Constructor Summary
PySequenceList()
           
PySequenceList(java.util.Collection c)
           
PySequenceList(PyObject[] elements)
          Creates an instance directly backed by the array of PyObject elements.
 
Method Summary
 void add(int index, java.lang.Object element)
           
 boolean add(java.lang.Object o)
           
 boolean addAll(java.util.Collection c)
           
 boolean addAll(int index, java.util.Collection c)
           
 void clear()
           
 boolean contains(java.lang.Object o)
           
 boolean containsAll(java.util.Collection c)
           
 boolean equals(java.lang.Object o)
          Should almost never be overridden.
 java.lang.Object get(int index)
           
 PyObject[] getArray()
          Get the backing array.
 int hashCode()
           
 int indexOf(java.lang.Object o)
           
 boolean isEmpty()
           
 java.util.Iterator iterator()
           
 int lastIndexOf(java.lang.Object o)
           
 java.util.ListIterator listIterator()
           
 java.util.ListIterator listIterator(int index)
           
 void pyadd(int index, PyObject element)
           
 boolean pyadd(PyObject o)
           
 PyObject pyget(int index)
           
 PyObject pyset(int index, PyObject element)
           
 java.lang.Object remove(int index)
           
 void remove(int start, int stop)
           
 boolean remove(java.lang.Object o)
           
 boolean removeAll(java.util.Collection c)
           
 boolean retainAll(java.util.Collection c)
           
 java.lang.Object set(int index, java.lang.Object element)
           
 int size()
           
 java.util.List subList(int fromIndex, int toIndex)
           
 java.lang.Object[] toArray()
           
 java.lang.Object[] toArray(java.lang.Object[] a)
           
 java.lang.String toString()
           
 
Methods inherited from class org.python.core.PySequence
__delitem__, __delslice__, __eq__, __finditem__, __finditem__, __ge__, __getitem__, __getslice__, __gt__, __iter__, __le__, __lt__, __ne__, __nonzero__, __setitem__, __setitem__, __setslice__, __tojava__, classDictInit, isMappingType, isNumberType
 
Methods inherited from class org.python.core.PyObject
__abs__, __add__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __cmp__, __coerce__, __coerce_ex__, __complex__, __contains__, __delattr__, __delattr__, __delete__, __delitem__, __delslice__, __dir__, __div__, __divmod__, __findattr__, __findattr__, __finditem__, __float__, __floordiv__, __get__, __getattr__, __getattr__, __getitem__, __getslice__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __iternext__, __itruediv__, __ixor__, __len__, __long__, __lshift__, __mod__, __mul__, __neg__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __repr__, __rfloordiv__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __set__, __setattr__, __setattr__, __setitem__, __setslice__, __str__, __sub__, __truediv__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _doget, _doget, _doset, _eq, _floordiv, _ge, _gt, _in, _is, _isnot, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _truediv, _xor, asInt, asLong, asName, asString, asStringOrNull, dispatch__init__, fastGetClass, fastGetDict, getDict, getDoc, getType, implementsDescrDelete, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isSequenceType, noAttributeError, readonlyAttributeError, safeRepr, typeSetup
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PySequenceList

public PySequenceList()

PySequenceList

public PySequenceList(PyObject[] elements)
Creates an instance directly backed by the array of PyObject elements.

Parameters:
elements -

PySequenceList

public PySequenceList(java.util.Collection c)
Method Detail

add

public void add(int index,
                java.lang.Object element)
Specified by:
add in interface java.util.List

add

public boolean add(java.lang.Object o)
Specified by:
add in interface java.util.List

addAll

public boolean addAll(int index,
                      java.util.Collection c)
Specified by:
addAll in interface java.util.List

addAll

public boolean addAll(java.util.Collection c)
Specified by:
addAll in interface java.util.List

clear

public void clear()
Specified by:
clear in interface java.util.List

contains

public boolean contains(java.lang.Object o)
Specified by:
contains in interface java.util.List

containsAll

public boolean containsAll(java.util.Collection c)
Specified by:
containsAll in interface java.util.List

get

public java.lang.Object get(int index)
Specified by:
get in interface java.util.List

indexOf

public int indexOf(java.lang.Object o)
Specified by:
indexOf in interface java.util.List

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface java.util.List

iterator

public java.util.Iterator iterator()
Specified by:
iterator in interface java.util.List

lastIndexOf

public int lastIndexOf(java.lang.Object o)
Specified by:
lastIndexOf in interface java.util.List

listIterator

public java.util.ListIterator listIterator()
Specified by:
listIterator in interface java.util.List

listIterator

public java.util.ListIterator listIterator(int index)
Specified by:
listIterator in interface java.util.List

pyadd

public void pyadd(int index,
                  PyObject element)

pyget

public PyObject pyget(int index)
Parameters:
index - index of element to return.
Returns:
the element at the given position in the list.

pyset

public PyObject pyset(int index,
                      PyObject element)

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List

remove

public void remove(int start,
                   int stop)

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.List

removeAll

public boolean removeAll(java.util.Collection c)
Specified by:
removeAll in interface java.util.List

retainAll

public boolean retainAll(java.util.Collection c)
Specified by:
retainAll in interface java.util.List

set

public java.lang.Object set(int index,
                            java.lang.Object element)
Specified by:
set in interface java.util.List

size

public int size()
Specified by:
size in interface java.util.List

subList

public java.util.List subList(int fromIndex,
                              int toIndex)
Specified by:
subList in interface java.util.List

toArray

public java.lang.Object[] toArray()
Specified by:
toArray in interface java.util.List

toArray

public java.lang.Object[] toArray(java.lang.Object[] a)
Specified by:
toArray in interface java.util.List

toString

public java.lang.String toString()
Overrides:
toString in class PyObject

pyadd

public boolean pyadd(PyObject o)

equals

public boolean equals(java.lang.Object o)
Description copied from class: PyObject
Should almost never be overridden. If overridden, it is the subclasses responsibility to ensure that a.equals(b) == true iff cmp(a,b) == 0

Specified by:
equals in interface java.util.List
Overrides:
equals in class PyObject

hashCode

public int hashCode()
Specified by:
hashCode in interface java.util.List
Overrides:
hashCode in class PyObject

getArray

public PyObject[] getArray()
Get the backing array. The array should not be modified. To get a copy of the array, see toArray().

Returns:
backing array object


Jython homepage