org.python.core

Class PyString

Implemented Interfaces:
ClassDictInit, java.io.Serializable
Known Direct Subclasses:
PyStringDerived, PyUnicode, SyspathArchive

public class PyString
extends PyBaseString
implements ClassDictInit

A builtin python string.
See Also:
Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class org.python.core.PyObject

PyObject.ConversionException

Field Summary

static String
exposed_name

Fields inherited from class org.python.core.PyBaseString

exposed_base, exposed_name

Fields inherited from class org.python.core.PyObject

exposed_name

Constructor Summary

PyString()
PyString(String string)
PyString(char c)
PyString(PyType subType, String string)

Method Summary

PyObject
__add__(PyObject generic_other)
int
__cmp__(PyObject other)
PyComplex
__complex__()
boolean
__contains__(PyObject o)
PyObject
__eq__(PyObject other)
PyFloat
__float__()
PyObject
__ge__(PyObject other)
PyTuple
__getnewargs__()
PyObject
__gt__(PyObject other)
PyObject
__int__()
PyObject
__invert__()
PyObject
__le__(PyObject other)
int
__len__()
PyLong
__long__()
PyObject
__lt__(PyObject other)
PyObject
__mod__(PyObject other)
PyObject
__ne__(PyObject other)
PyObject
__neg__()
PyObject
__pos__()
PyObject
__reduce__()
Used for pickling.
PyString
__repr__()
PyString
__str__()
Object
__tojava__(Class c)
PyUnicode
__unicode__()
String
asName(int index)
String
asString(int index)
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)
PyString
createInstance(String str)
String
decode()
String
decode(String encoding)
String
decode(String encoding, String errors)
static String
decode_UnicodeEscape(String str, int start, int end, String errors, boolean unicode)
String
encode()
String
encode(String encoding)
String
encode(String encoding, String errors)
static String
encode_UnicodeEscape(String str, boolean use_quotes)
boolean
endswith(String suffix)
boolean
endswith(String suffix, int start)
boolean
endswith(String suffix, int start, int end)
boolean
equals(Object other)
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
lstrip(String sep)
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
rstrip(String sep)
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)
PyObject
str___mod__(PyObject other)
String
strip()
String
strip(String sep)
String
swapcase()
String
title()
String
toString()
static byte[]
to_bytes(String s)
String
translate(String table)
String
translate(String table, String deletechars)
String
translate(PyObject table)
static void
typeSetup(PyObject dict, PyType.Newstyle marker)
String
upper()
String
zfill(int width)

Methods inherited from class org.python.core.PyBaseString

typeSetup

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__, __delitem__, __delslice__, __delslice__, __dir__, __div__, __divmod__, __eq__, __findattr__, __findattr__, __finditem__, __finditem__, __finditem__, __float__, __floordiv__, __ge__, __get__, __getattr__, __getattr__, __getitem__, __getitem__, __getnewargs__, __getslice__, __getslice__, __gt__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __iter__, __iternext__, __itruediv__, __ixor__, __le__, __len__, __long__, __lshift__, __lt__, __mod__, __mul__, __ne__, __neg__, __nonzero__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __reduce__, __repr__, __rfloordiv__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __set__, __setattr__, __setattr__, __setitem__, __setitem__, __setitem__, __setslice__, __setslice__, __str__, __sub__, __tojava__, __truediv__, __unicode__, __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, delDict, delType, dispatch__init__, equals, fastGetClass, fastGetDict, getDict, getDoc, getType, hashCode, implementsDescrDelete, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isMappingType, isNumberType, isSequenceType, noAttributeError, readonlyAttributeError, safeRepr, setDict, setType, toString, typeSetup

Field Details

exposed_name

public static final String exposed_name

Constructor Details

PyString

public PyString()

PyString

public PyString(String string)

PyString

public PyString(char c)

PyString

public PyString(PyType subType,
                String string)

Method Details

__add__

public PyObject __add__(PyObject generic_other)
Overrides:
__add__ in interface PyObject

__cmp__

public int __cmp__(PyObject other)
Overrides:
__cmp__ in interface PyObject

__complex__

public PyComplex __complex__()
Overrides:
__complex__ in interface PyObject

__contains__

public boolean __contains__(PyObject o)
Overrides:
__contains__ in interface PyObject

__eq__

public PyObject __eq__(PyObject other)
Overrides:
__eq__ in interface PySequence

__float__

public PyFloat __float__()
Overrides:
__float__ in interface PyObject

__ge__

public PyObject __ge__(PyObject other)
Overrides:
__ge__ in interface PySequence

__getnewargs__

public PyTuple __getnewargs__()
Overrides:
__getnewargs__ in interface PyObject

__gt__

public PyObject __gt__(PyObject other)
Overrides:
__gt__ in interface PySequence

__int__

public PyObject __int__()
Overrides:
__int__ in interface PyObject

__invert__

public PyObject __invert__()
Overrides:
__invert__ in interface PyObject

__le__

public PyObject __le__(PyObject other)
Overrides:
__le__ in interface PySequence

__len__

public int __len__()
Overrides:
__len__ in interface PyObject

__long__

public PyLong __long__()
Overrides:
__long__ in interface PyObject

__lt__

public PyObject __lt__(PyObject other)
Overrides:
__lt__ in interface PySequence

__mod__

public PyObject __mod__(PyObject other)
Overrides:
__mod__ in interface PyObject

__ne__

public PyObject __ne__(PyObject other)
Overrides:
__ne__ in interface PySequence

__neg__

public PyObject __neg__()
Overrides:
__neg__ in interface PyObject

__pos__

public PyObject __pos__()
Overrides:
__pos__ in interface PyObject

__reduce__

public PyObject __reduce__()
Used for pickling.
Overrides:
__reduce__ in interface PyObject
Returns:
a tuple of (class, tuple)

__repr__

public PyString __repr__()
Overrides:
__repr__ in interface PyObject

__str__

public PyString __str__()
Overrides:
__str__ in interface PyObject

__tojava__

public Object __tojava__(Class c)
Overrides:
__tojava__ in interface PySequence

__unicode__

public PyUnicode __unicode__()
Overrides:
__unicode__ in interface PyObject

asName

public String asName(int index)
            throws PyObject.ConversionException
Overrides:
asName in interface PyObject

asString

public String asString(int index)
            throws PyObject.ConversionException
Overrides:
asString in interface PyObject

atof

public double atof()

atoi

public int atoi()

atoi

public int atoi(int base)

atol

public PyLong atol()

atol

public PyLong atol(int base)

capitalize

public String capitalize()

center

public String center(int width)

classDictInit

public static void classDictInit(PyObject dict)
            throws PyIgnoreMethodTag
Internal use only. Do not call this method explicit.
Overrides:
classDictInit in interface PySequence

count

public int count(String sub)

count

public int count(String sub,
                 int start)

count

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

createInstance

public PyString createInstance(String str)

decode

public String decode()

decode

public String decode(String encoding)

decode

public String decode(String encoding,
                     String errors)

decode_UnicodeEscape

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

encode

public String encode()

encode

public String encode(String encoding)

encode

public String encode(String encoding,
                     String errors)

encode_UnicodeEscape

public static String encode_UnicodeEscape(String str,
                                          boolean use_quotes)

endswith

public boolean endswith(String suffix)

endswith

public boolean endswith(String suffix,
                        int start)

endswith

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

equals

public boolean equals(Object other)
Overrides:
equals in interface PyObject

expandtabs

public String expandtabs()

expandtabs

public String expandtabs(int tabsize)

find

public int find(String sub)

find

public int find(String sub,
                int start)

find

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

hashCode

public int hashCode()
Overrides:
hashCode in interface PyObject

index

public int index(String sub)

index

public int index(String sub,
                 int start)

index

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

internedString

public String internedString()

isalnum

public boolean isalnum()

isalpha

public boolean isalpha()

isdecimal

public boolean isdecimal()

isdigit

public boolean isdigit()

islower

public boolean islower()

isnumeric

public boolean isnumeric()

isspace

public boolean isspace()

istitle

public boolean istitle()

isunicode

public boolean isunicode()

isupper

public boolean isupper()

join

public String join(PyObject seq)

ljust

public String ljust(int width)

lower

public String lower()

lstrip

public String lstrip()

lstrip

public String lstrip(String sep)

replace

public String replace(String oldPiece,
                      String newPiece)

replace

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

rfind

public int rfind(String sub)

rfind

public int rfind(String sub,
                 int start)

rfind

public int rfind(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)

rjust

public String rjust(int width)

rstrip

public String rstrip()

rstrip

public String rstrip(String sep)

safeRepr

public String safeRepr()
            throws PyIgnoreMethodTag
Overrides:
safeRepr in interface PyObject

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)

startswith

public boolean startswith(String prefix)

startswith

public boolean startswith(String prefix,
                          int offset)

startswith

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

str___mod__

public PyObject str___mod__(PyObject other)

strip

public String strip()

strip

public String strip(String sep)

swapcase

public String swapcase()

title

public String title()

toString

public String toString()
Overrides:
toString in interface PyObject

to_bytes

public static byte[] to_bytes(String s)

translate

public String translate(String table)

translate

public String translate(String table,
                        String deletechars)

translate

public String translate(PyObject table)

typeSetup

public static void typeSetup(PyObject dict,
                             PyType.Newstyle marker)
Overrides:
typeSetup in interface PyBaseString

upper

public String upper()

zfill

public String zfill(int width)

Jython homepage