org.python.core
Class PyString

java.lang.Object
  extended byorg.python.core.PyObject
      extended byorg.python.core.PySequence
          extended byorg.python.core.PyString
All Implemented Interfaces:
ClassDictInit, Serializable
Direct Known Subclasses:
PyCompositeString, SyspathArchive

public class PyString
extends PySequence
implements ClassDictInit

A builtin python string.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.python.core.PySequence
annotation
 
Fields inherited from class org.python.core.PyObject
__class__
 
Constructor Summary
PyString()
           
PyString(char c)
           
PyString(String string)
           
 
Method Summary
 PyObject __add__(PyObject generic_other)
          Equivalent to the standard Python __add__ method
 PyObject __anye__(PyObject other)
           
 PyObject __bde__(PyObject other)
           
 int __cmp__(PyObject other)
          Equivalent to the standard Python __cmp__ method.
 PyComplex __complex__()
          Equivalent to the standard Python __complex__ method.
 boolean __contains__(PyObject o)
          Equivalent to the standard Python __contains__ method.
 PyObject __eq__(PyObject other)
          Equivalent to the standard Python __eq__ method.
 PyFloat __float__()
          Equivalent to the standard Python __float__ method.
 PyObject __ge__(PyObject other)
          Equivalent to the standard Python __ge__ method.
 PyObject __gt__(PyObject other)
          Equivalent to the standard Python __gt__ method.
 PyInteger __int__()
          Equivalent to the standard Python __int__ method.
 PyObject __lde__(PyObject other)
           
 PyObject __le__(PyObject other)
          Equivalent to the standard Python __le__ method.
 int __len__()
          Equivalent to the standard Python __len__ method.
 PyLong __long__()
          Equivalent to the standard Python __long__ method.
 PyObject __lt__(PyObject other)
          Equivalent to the standard Python __lt__ method.
 PyObject __mod__(PyObject other)
          Equivalent to the standard Python __mod__ method
 PyObject __ne__(PyObject other)
          Equivalent to the standard Python __ne__ method.
 PyObject __rde__(PyObject other)
           
 PyString __repr__()
          Equivalent to the standard Python __repr__ method.
 PyString __str__()
          Equivalent to the standard Python __str__ method.
 Object __tojava__(Class c)
          Equivalent to the Jython __tojava__ method.
 double atof()
           
 int atoi()
           
 int atoi(int base)
           
 PyLong atol()
           
 PyLong atol(int base)
           
 String capitalize()
           
 String center(int width)
           
static void classDictInit(PyObject dict)
          Internal use only.
 int count(String sub)
           
 int count(String sub, int start)
           
 int count(String sub, int start, int end)
           
static String decode_UnicodeEscape(String str, int start, int end, String errors, boolean unicode)
           
static String encode_UnicodeEscape(String str, boolean use_quotes)
           
 PyString encode()
           
 PyString encode(String encoding)
           
 PyString encode(String encoding, String errors)
           
 boolean endswith(String suffix)
           
 boolean endswith(String suffix, int start)
           
 boolean endswith(String suffix, int start, int end)
           
 boolean equals(Object other)
          Should almost never be overridden.
 String expandtabs()
           
 String expandtabs(int tabsize)
           
 int find(String sub)
           
 int find(String sub, int start)
           
 int find(String sub, int start, int end)
           
 int hashCode()
           
 int index(String sub)
           
 int index(String sub, int start)
           
 int index(String sub, int start, int end)
           
 String internedString()
           
 boolean isalnum()
           
 boolean isalpha()
           
 boolean isdecimal()
           
 boolean isdigit()
           
 boolean islower()
           
 boolean isnumeric()
           
 boolean isspace()
           
 boolean istitle()
           
 boolean isunicode()
           
 boolean isupper()
           
 String join(PyObject seq)
           
 String ljust(int width)
           
 String lower()
           
 String lstrip()
           
 String replace(String oldPiece, String newPiece)
           
 String replace(String oldPiece, String newPiece, int maxsplit)
           
 int rfind(String sub)
           
 int rfind(String sub, int start)
           
 int rfind(String sub, int start, int end)
           
 int rindex(String sub)
           
 int rindex(String sub, int start)
           
 int rindex(String sub, int start, int end)
           
 String rjust(int width)
           
 String rstrip()
           
 String safeRepr()
           
 PyList split()
           
 PyList split(String sep)
           
 PyList split(String sep, int maxsplit)
           
 PyList splitlines()
           
 PyList splitlines(boolean keepends)
           
 boolean startswith(String prefix)
           
 boolean startswith(String prefix, int offset)
           
 boolean startswith(String prefix, int start, int end)
           
 String strip()
           
 String swapcase()
           
 String title()
           
 String toString()
           
 String translate(PyObject table)
           
 String translate(String table)
           
 String translate(String table, String deletechars)
           
 String upper()
           
 String zfill(int width)
           
 
Methods inherited from class org.python.core.PySequence
__and__, __delitem__, __delslice__, __findattr__, __finditem__, __finditem__, __getitem__, __getslice__, __nonzero__, __or__, __setattr__, __setitem__, __setitem__, __setslice__, __sub__, containsGraphElements, findEdges, findEdges, findGraphElements, findGraphElements, findNodes, findNodes, findNodesAndEdges, findNodesAndEdges, getAnnotation, groupAndSortBy, groupBy, hide, isMappingType, isNumberType, show, size, sortBy, unroll
 
Methods inherited from class org.python.core.PyObject
__abs__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __coerce__, __coerce_ex__, __delattr__, __delattr__, __delitem__, __delslice__, __dir__, __div__, __divmod__, __findattr__, __finditem__, __getattr__, __getattr__, __getitem__, __getslice__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ilshift__, __imod__, __imul__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __like__, __lshift__, __mul__, __neg__, __not__, __oct__, __pos__, __pow__, __pow__, __radd__, __rand__, __rcontained__, __rcontains__, __rdiv__, __rdivmod__, __rexact__, __rlshift__, __rmod__, __rmul__, __ror__, __roverlaps__, __rpow__, __rrshift__, __rshift__, __rsub__, __rxor__, __setattr__, __setitem__, __setslice__, __str2__, __xor__, _add, _and, _anye, _bde, _callextra, _cmp, _div, _divmod, _dodel, _doget, _doget, _doset, _eq, _ge, _gt, _in, _is, _isnot, _jcall, _jcallexc, _jthrow, _lde, _le, _like, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rcontained, _rcontains, _rde, _rexact, _roverlaps, _rshift, _sub, _xor, invoke, invoke, invoke, invoke, invoke, isCallable, isSequenceType
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PyString

public PyString()

PyString

public PyString(String string)

PyString

public PyString(char c)
Method Detail

classDictInit

public static void classDictInit(PyObject dict)
Internal use only. Do not call this method explicit.


safeRepr

public String safeRepr()
                throws PyIgnoreMethodTag
Overrides:
safeRepr in class PyObject
Throws:
PyIgnoreMethodTag

__str__

public PyString __str__()
Description copied from class: PyObject
Equivalent to the standard Python __str__ method. This method should not typically need to be overridden. The easiest way to configure the string representation of a PyObject is to override the standard Java toString method.

Overrides:
__str__ in class PyObject

__len__

public int __len__()
Description copied from class: PyObject
Equivalent to the standard Python __len__ method. Part of the mapping discipline.

Overrides:
__len__ in class PyObject
Returns:
the length of the object

toString

public String toString()

internedString

public String internedString()

__repr__

public PyString __repr__()
Description copied from class: PyObject
Equivalent to the standard Python __repr__ method. This method should not typically need to be overrriden. The easiest way to configure the string representation of a PyObject is to override the standard Java toString method.

Overrides:
__repr__ in class PyObject

encode_UnicodeEscape

public static String encode_UnicodeEscape(String str,
                                          boolean use_quotes)

decode_UnicodeEscape

public static String decode_UnicodeEscape(String str,
                                          int start,
                                          int end,
                                          String errors,
                                          boolean unicode)

equals

public boolean equals(Object other)
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

Overrides:
equals in class PyObject

__cmp__

public int __cmp__(PyObject other)
Description copied from class: PyObject
Equivalent to the standard Python __cmp__ method.

Overrides:
__cmp__ in class PyObject
Parameters:
other - the object to compare this with.
Returns:
-1 if this < 0; 0 if this == o; +1 if this > o; -2 if no comparison is implemented

__eq__

public PyObject __eq__(PyObject other)
Description copied from class: PyObject
Equivalent to the standard Python __eq__ method.

Overrides:
__eq__ in class PySequence

__ne__

public PyObject __ne__(PyObject other)
Description copied from class: PyObject
Equivalent to the standard Python __ne__ method.

Overrides:
__ne__ in class PySequence

__lde__

public PyObject __lde__(PyObject other)
Overrides:
__lde__ in class PySequence

__anye__

public PyObject __anye__(PyObject other)
Overrides:
__anye__ in class PySequence

__rde__

public PyObject __rde__(PyObject other)
Overrides:
__rde__ in class PySequence

__bde__

public PyObject __bde__(PyObject other)
Overrides:
__bde__ in class PySequence

__lt__

public PyObject __lt__(PyObject other)
Description copied from class: PyObject
Equivalent to the standard Python __lt__ method.

Overrides:
__lt__ in class PySequence

__le__

public PyObject __le__(PyObject other)
Description copied from class: PyObject
Equivalent to the standard Python __le__ method.

Overrides:
__le__ in class PySequence

__gt__

public PyObject __gt__(PyObject other)
Description copied from class: PyObject
Equivalent to the standard Python __gt__ method.

Overrides:
__gt__ in class PySequence

__ge__

public PyObject __ge__(PyObject other)
Description copied from class: PyObject
Equivalent to the standard Python __ge__ method.

Overrides:
__ge__ in class PySequence

hashCode

public int hashCode()
Overrides:
hashCode in class PyObject

__tojava__

public Object __tojava__(Class c)
Description copied from class: PyObject
Equivalent to the Jython __tojava__ method. Tries to coerce this object to an instance of the requested Java class. Returns the special object Py.NoConversion if this PyObject can not be converted to the desired Java class.

Overrides:
__tojava__ in class PySequence

__contains__

public boolean __contains__(PyObject o)
Description copied from class: PyObject
Equivalent to the standard Python __contains__ method.

Overrides:
__contains__ in class PyObject
Parameters:
o - the element to search for in this container.
Returns:
the result of the search.

__add__

public PyObject __add__(PyObject generic_other)
Description copied from class: PyObject
Equivalent to the standard Python __add__ method

Overrides:
__add__ in class PyObject
Parameters:
generic_other - the object to perform this binary operation with (the right-hand operand).
Returns:
the result of the add, or null if this operation is not defined

__mod__

public PyObject __mod__(PyObject other)
Description copied from class: PyObject
Equivalent to the standard Python __mod__ method

Overrides:
__mod__ in class PyObject
Parameters:
other - the object to perform this binary operation with (the right-hand operand).
Returns:
the result of the mod, or null if this operation is not defined

__int__

public PyInteger __int__()
Description copied from class: PyObject
Equivalent to the standard Python __int__ method. Should only be overridden by numeric objects that can be reasonably coerced into an integer.

Overrides:
__int__ in class PyObject
Returns:
an integer corresponding to the value of this object.

__long__

public PyLong __long__()
Description copied from class: PyObject
Equivalent to the standard Python __long__ method. Should only be overridden by numeric objects that can be reasonably coerced into a python long.

Overrides:
__long__ in class PyObject
Returns:
a PyLong corresponding to the value of this object.

__float__

public PyFloat __float__()
Description copied from class: PyObject
Equivalent to the standard Python __float__ method. Should only be overridden by numeric objects that can be reasonably coerced into a python float.

Overrides:
__float__ in class PyObject
Returns:
a float corresponding to the value of this object.

__complex__

public PyComplex __complex__()
Description copied from class: PyObject
Equivalent to the standard Python __complex__ method. Should only be overridden by numeric objects that can be reasonably coerced into a python complex number.

Overrides:
__complex__ in class PyObject
Returns:
a complex number corresponding to the value of this object.

lower

public String lower()

upper

public String upper()

title

public String title()

swapcase

public String swapcase()

strip

public String strip()

lstrip

public String lstrip()

rstrip

public String rstrip()

split

public PyList split()

split

public PyList split(String sep)

split

public PyList split(String sep,
                    int maxsplit)

splitlines

public PyList splitlines()

splitlines

public PyList splitlines(boolean keepends)

index

public int index(String sub)

index

public int index(String sub,
                 int start)

index

public int index(String sub,
                 int start,
                 int end)

rindex

public int rindex(String sub)

rindex

public int rindex(String sub,
                  int start)

rindex

public int rindex(String sub,
                  int start,
                  int end)

count

public int count(String sub)

count

public int count(String sub,
                 int start)

count

public int count(String sub,
                 int start,
                 int end)

find

public int find(String sub)

find

public int find(String sub,
                int start)

find

public int find(String sub,
                int start,
                int end)

rfind

public int rfind(String sub)

rfind

public int rfind(String sub,
                 int start)

rfind

public int rfind(String sub,
                 int start,
                 int end)

atof

public double atof()

atoi

public int atoi()

atoi

public int atoi(int base)

atol

public PyLong atol()

atol

public PyLong atol(int base)

ljust

public String ljust(int width)

rjust

public String rjust(int width)

center

public String center(int width)

zfill

public String zfill(int width)

expandtabs

public String expandtabs()

expandtabs

public String expandtabs(int tabsize)

capitalize

public String capitalize()

replace

public String replace(String oldPiece,
                      String newPiece)

replace

public String replace(String oldPiece,
                      String newPiece,
                      int maxsplit)

join

public String join(PyObject seq)

startswith

public boolean startswith(String prefix)

startswith

public boolean startswith(String prefix,
                          int offset)

startswith

public boolean startswith(String prefix,
                          int start,
                          int end)

endswith

public boolean endswith(String suffix)

endswith

public boolean endswith(String suffix,
                        int start)

endswith

public boolean endswith(String suffix,
                        int start,
                        int end)

translate

public String translate(String table)

translate

public String translate(String table,
                        String deletechars)

translate

public String translate(PyObject table)

islower

public boolean islower()

isupper

public boolean isupper()

isalpha

public boolean isalpha()

isalnum

public boolean isalnum()

isdecimal

public boolean isdecimal()

isdigit

public boolean isdigit()

isnumeric

public boolean isnumeric()

istitle

public boolean istitle()

isspace

public boolean isspace()

isunicode

public boolean isunicode()

encode

public PyString encode()

encode

public PyString encode(String encoding)

encode

public PyString encode(String encoding,
                       String errors)