public class PyString extends PyBaseString implements BufferProtocol
PyObject.ConversionException| Constructor and Description |
|---|
PyString() |
PyString(char c) |
PyString(PyType subType,
java.lang.String string) |
PyString(java.lang.String string) |
| Modifier and Type | Method and Description |
|---|---|
PyObject |
__add__(PyObject other)
Equivalent to the standard Python __add__ method
|
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 |
__format__(PyObject formatSpec) |
PyObject |
__ge__(PyObject other)
Equivalent to the standard Python __ge__ method.
|
PyTuple |
__getnewargs__() |
PyObject |
__gt__(PyObject other)
Equivalent to the standard Python __gt__ method.
|
PyObject |
__int__()
Equivalent to the standard Python __int__ method.
|
PyObject |
__invert__()
Equivalent to the standard Python __invert__ method.
|
PyObject |
__le__(PyObject other)
Equivalent to the standard Python __le__ method.
|
int |
__len__()
Equivalent to the standard Python __len__ method.
|
PyObject |
__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 |
__mul__(PyObject o)
Equivalent to the standard Python __mul__ method
|
PyObject |
__ne__(PyObject other)
Equivalent to the standard Python __ne__ method.
|
PyObject |
__neg__()
Equivalent to the standard Python __neg__ method.
|
PyObject |
__pos__()
Equivalent to the standard Python __pos__ method.
|
PyString |
__repr__()
Equivalent to the standard Python __repr__ method.
|
PyObject |
__rmul__(PyObject o)
Equivalent to the standard Python __rmul__ method
|
PyString |
__str__()
Equivalent to the standard Python __str__ method.
|
java.lang.Object |
__tojava__(java.lang.Class<?> c)
Equivalent to the Jython __tojava__ method.
|
PyUnicode |
__unicode__() |
double |
asDouble()
Convert this object into a double.
|
int |
asInt()
Convert this object into an int.
|
long |
asLong()
Convert this object longo an long.
|
java.lang.String |
asName(int index) |
java.lang.String |
asString() |
java.lang.String |
asString(int index) |
double |
atof() |
int |
atoi() |
int |
atoi(int base) |
PyLong |
atol() |
PyLong |
atol(int base) |
java.lang.String |
capitalize() |
java.lang.String |
center(int width) |
int |
count(java.lang.String sub) |
int |
count(java.lang.String sub,
PyObject start) |
int |
count(java.lang.String sub,
PyObject start,
PyObject end) |
PyString |
createInstance(java.lang.String str) |
static java.lang.String |
decode_UnicodeEscape(java.lang.String str,
int start,
int end,
java.lang.String errors,
boolean unicode) |
PyObject |
decode() |
PyObject |
decode(java.lang.String encoding) |
PyObject |
decode(java.lang.String encoding,
java.lang.String errors) |
static java.lang.String |
encode_UnicodeEscape(java.lang.String str,
boolean use_quotes) |
java.lang.String |
encode() |
java.lang.String |
encode(java.lang.String encoding) |
java.lang.String |
encode(java.lang.String encoding,
java.lang.String errors) |
boolean |
endswith(PyObject suffix) |
boolean |
endswith(PyObject suffix,
PyObject start) |
boolean |
endswith(PyObject suffix,
PyObject start,
PyObject end) |
java.lang.String |
expandtabs() |
java.lang.String |
expandtabs(int tabsize) |
int |
find(java.lang.String sub) |
int |
find(java.lang.String sub,
PyObject start) |
int |
find(java.lang.String sub,
PyObject start,
PyObject end) |
static java.lang.String |
formatString(java.lang.String text,
InternalFormatSpec spec)
Internal implementation of str.
|
static PyString |
fromInterned(java.lang.String interned)
Creates a PyString from an already interned String.
|
PyBuffer |
getBuffer(int flags)
Return a read-only buffer view of the contents of the string, treating it as a sequence of
unsigned bytes.
|
java.lang.String |
getString() |
int |
hashCode() |
int |
index(java.lang.String sub) |
int |
index(java.lang.String sub,
PyObject start) |
int |
index(java.lang.String sub,
PyObject start,
PyObject end) |
java.lang.String |
internedString() |
boolean |
isalnum() |
boolean |
isalpha() |
boolean |
isdecimal() |
boolean |
isdigit() |
boolean |
islower() |
boolean |
isnumeric() |
boolean |
isspace() |
boolean |
istitle() |
boolean |
isunicode() |
boolean |
isupper() |
PyString |
join(PyObject seq) |
java.lang.String |
ljust(int width) |
java.lang.String |
ljust(int width,
java.lang.String padding) |
java.lang.String |
lower() |
java.lang.String |
lstrip() |
java.lang.String |
lstrip(java.lang.String sep) |
PyTuple |
partition(PyObject sepObj) |
int |
rfind(java.lang.String sub) |
int |
rfind(java.lang.String sub,
PyObject start) |
int |
rfind(java.lang.String sub,
PyObject start,
PyObject end) |
int |
rindex(java.lang.String sub) |
int |
rindex(java.lang.String sub,
PyObject start) |
int |
rindex(java.lang.String sub,
PyObject start,
PyObject end) |
java.lang.String |
rjust(int width) |
PyTuple |
rpartition(PyObject sepObj) |
PyList |
rsplit() |
PyList |
rsplit(java.lang.String sep) |
PyList |
rsplit(java.lang.String sep,
int maxsplit) |
java.lang.String |
rstrip(java.lang.String sep) |
PyList |
split() |
PyList |
split(java.lang.String sep) |
PyList |
split(java.lang.String sep,
int maxsplit) |
PyList |
splitlines() |
PyList |
splitlines(boolean keepends) |
boolean |
startswith(PyObject prefix) |
boolean |
startswith(PyObject prefix,
PyObject offset) |
boolean |
startswith(PyObject prefix,
PyObject start,
PyObject end) |
PyObject |
str___mod__(PyObject other) |
PyString |
str___str__() |
java.lang.String |
strip() |
java.lang.String |
strip(java.lang.String sep) |
java.lang.String |
substring(int start,
int end) |
java.lang.String |
swapcase() |
java.lang.String |
title() |
byte[] |
toBytes() |
int[] |
toCodePoints() |
java.lang.String |
toString() |
java.lang.String |
translate() |
java.lang.String |
translate(PyObject table) |
java.lang.String |
translate(java.lang.String table) |
java.lang.String |
translate(java.lang.String table,
java.lang.String deletechars) |
java.lang.String |
upper() |
java.lang.String |
zfill(int width) |
__delitem__, __delslice__, __finditem__, __finditem__, __getitem__, __getslice__, __iter__, __nonzero__, __setitem__, __setitem__, __setslice__, isMappingType, isNumberType, isSequenceType__abs__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __coerce__, __coerce_ex__, __delattr__, __delattr__, __delete__, __delitem__, __delslice__, __dir__, __div__, __divmod__, __findattr__, __findattr__, __findattr_ex__, __finditem__, __floordiv__, __get__, __getattr__, __getattr__, __getitem__, __getslice__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __index__, __ior__, __ipow__, __irshift__, __isub__, __iternext__, __itruediv__, __ixor__, __lshift__, __not__, __oct__, __or__, __pow__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __reduce__, __reduce_ex__, __reduce_ex__, __rfloordiv__, __rlshift__, __rmod__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __set__, __setattr__, __setattr__, __setitem__, __setslice__, __sub__, __truediv__, __trunc__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _doget, _doget, _doset, _eq, _floordiv, _ge, _gt, _iadd, _iand, _idiv, _idivmod, _ifloordiv, _ilshift, _imod, _imul, _in, _ior, _ipow, _irshift, _is, _isnot, _isub, _itruediv, _ixor, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _truediv, _xor, asIndex, asIndex, asInt, asIterable, asLong, asName, asStringOrNull, asStringOrNull, bit_length, conjugate, delDict, delType, dispatch__init__, equals, fastGetClass, fastGetDict, getDict, getType, implementsDescrDelete, implementsDescrGet, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isIndex, noAttributeError, object___subclasshook__, readonlyAttributeError, setDict, setTypepublic static final PyType TYPE
public PyString()
public PyString(PyType subType, java.lang.String string)
public PyString(java.lang.String string)
public PyString(char c)
public java.lang.String getString()
public static PyString fromInterned(java.lang.String interned)
public int[] toCodePoints()
public PyBuffer getBuffer(int flags)
flags argument (see the constants in interface PyBUF for an
explanation). The method may return the same PyBuffer object to more than one consumer.getBuffer in interface BufferProtocolflags - consumer requirementspublic java.lang.String substring(int start,
int end)
public PyString __str__()
PyObjectPyObject is to
override the standard Java toString method.public final PyString str___str__()
public PyUnicode __unicode__()
__unicode__ in class PyObjectpublic int __len__()
PyObjectpublic java.lang.String internedString()
public PyString __repr__()
PyObjectPyObject is to
override the standard Java toString method.public static java.lang.String encode_UnicodeEscape(java.lang.String str,
boolean use_quotes)
public static java.lang.String decode_UnicodeEscape(java.lang.String str,
int start,
int end,
java.lang.String errors,
boolean unicode)
public int __cmp__(PyObject other)
PyObjectpublic PyObject __eq__(PyObject other)
PyObject__eq__ in class PySequenceother - the object to compare this with.public PyObject __ne__(PyObject other)
PyObject__ne__ in class PySequenceother - the object to compare this with.public PyObject __lt__(PyObject other)
PyObject__lt__ in class PySequenceother - the object to compare this with.public PyObject __le__(PyObject other)
PyObject__le__ in class PySequenceother - the object to compare this with.public PyObject __gt__(PyObject other)
PyObject__gt__ in class PySequenceother - the object to compare this with.public PyObject __ge__(PyObject other)
PyObject__ge__ in class PySequenceother - the object to compare this with.public byte[] toBytes()
public java.lang.Object __tojava__(java.lang.Class<?> c)
PyObjectPy.NoConversion
if this PyObject can not be converted to the
desired Java class.__tojava__ in class PySequencec - the Class to convert this PyObject to.public PyString createInstance(java.lang.String str)
public boolean __contains__(PyObject o)
PyObject__contains__ in class PyObjecto - the element to search for in this container.public PyObject __mul__(PyObject o)
PyObjectpublic PyObject __rmul__(PyObject o)
PyObjectpublic PyObject __add__(PyObject other)
PyObjectpublic PyTuple __getnewargs__()
__getnewargs__ in class PyObjectpublic PyObject __mod__(PyObject other)
PyObjectpublic PyObject __int__()
PyObjectpublic PyObject __long__()
PyObjectpublic PyFloat __float__()
PyObjectpublic PyObject __pos__()
PyObjectpublic PyObject __neg__()
PyObjectpublic PyObject __invert__()
PyObject__invert__ in class PyObjectpublic PyComplex __complex__()
PyObject__complex__ in class PyObjectpublic java.lang.String lower()
public java.lang.String upper()
public java.lang.String title()
public java.lang.String swapcase()
public java.lang.String strip()
public java.lang.String strip(java.lang.String sep)
public java.lang.String lstrip()
public java.lang.String lstrip(java.lang.String sep)
public java.lang.String rstrip(java.lang.String sep)
public PyList split()
public PyList split(java.lang.String sep)
public PyList split(java.lang.String sep, int maxsplit)
public PyList rsplit()
public PyList rsplit(java.lang.String sep)
public PyList rsplit(java.lang.String sep, int maxsplit)
public PyList splitlines()
public PyList splitlines(boolean keepends)
public int index(java.lang.String sub)
public int index(java.lang.String sub,
PyObject start)
public int rindex(java.lang.String sub)
public int rindex(java.lang.String sub,
PyObject start)
public int count(java.lang.String sub)
public int count(java.lang.String sub,
PyObject start)
public int find(java.lang.String sub)
public int find(java.lang.String sub,
PyObject start)
public int rfind(java.lang.String sub)
public int rfind(java.lang.String sub,
PyObject start)
public double atof()
public int atoi()
public int atoi(int base)
public PyLong atol()
public PyLong atol(int base)
public java.lang.String ljust(int width)
public java.lang.String ljust(int width,
java.lang.String padding)
public java.lang.String rjust(int width)
public java.lang.String center(int width)
public java.lang.String zfill(int width)
public java.lang.String expandtabs()
public java.lang.String expandtabs(int tabsize)
public java.lang.String capitalize()
public boolean startswith(PyObject prefix)
public boolean endswith(PyObject suffix)
public java.lang.String translate()
public java.lang.String translate(java.lang.String table)
public java.lang.String translate(java.lang.String table,
java.lang.String deletechars)
public java.lang.String translate(PyObject table)
public boolean islower()
public boolean isupper()
public boolean isalpha()
public boolean isalnum()
public boolean isdecimal()
public boolean isdigit()
public boolean isnumeric()
public boolean istitle()
public boolean isspace()
public boolean isunicode()
public java.lang.String encode()
public java.lang.String encode(java.lang.String encoding)
public java.lang.String encode(java.lang.String encoding,
java.lang.String errors)
public PyObject decode()
public PyObject decode(java.lang.String encoding)
public PyObject decode(java.lang.String encoding, java.lang.String errors)
public PyObject __format__(PyObject formatSpec)
__format__ in class PyObjectpublic static java.lang.String formatString(java.lang.String text,
InternalFormatSpec spec)
text - the text to formatspec - the PEP 3101 formatting specificationpublic java.lang.String asString(int index)
throws PyObject.ConversionException
asString in class PyObjectPyObject.ConversionExceptionpublic int asInt()
PyObjectpublic long asLong()
PyObjectpublic double asDouble()
PyObjectpublic java.lang.String asName(int index)
throws PyObject.ConversionException
asName in class PyObjectPyObject.ConversionException