Additional top-level class in compilation unit: StringFormatter.
| Modifier and Type | Field and Description |
|---|---|
| private static Pattern | complexPattern
Access only through |
| private Reference | export
Supports the buffer API, see |
| private static Pattern | floatPattern
Access only through |
| private static char[] | |
| protected transient boolean | |
| private static ucnhashAPI | |
| protected String | |
| private static final int | |
| public static final PyType | |
| private static final String | UF_RE
Regular expression for an unsigned Python float, accepting also any sequence of the letters that belong to "NaN" or "Infinity" in whatever case. |
| Access | Constructor and Description |
|---|---|
| public | |
| protected | |
| public | |
| public | |
| public | |
| pack-priv | |
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public PyObject | __add__(PyObject
the object to perform this binary operation with (the right-hand operand). other)Overrides org. Equivalent to the standard Python __add__ method. |
| public int | __cmp__(PyObject
the object to compare this with. other)Overrides org. Equivalent to the standard Python __cmp__ method. |
| public PyComplex | __complex__()
Overrides org. Equivalent to the standard Python __complex__ method. |
| public boolean | __contains__(PyObject
the element to search for in this container. o)Overrides org. Equivalent to the standard Python __contains__ method. |
| public PyObject | __eq__(PyObject
the object to compare this with. other)Overrides org. Equivalent to the standard Python __eq__ method. |
| public PyFloat | __float__()
Overrides org. Equivalent to the standard Python __float__ method. |
| public PyObject | |
| public PyObject | __ge__(PyObject
the object to compare this with. other)Overrides org. Equivalent to the standard Python __ge__ method. |
| public PyTuple | |
| public PyObject | __gt__(PyObject
the object to compare this with. other)Overrides org. Equivalent to the standard Python __gt__ method. |
| public PyObject | __int__()
Overrides org. Equivalent to the standard Python __int__ method. |
| public PyObject | __invert__()
Overrides org. Equivalent to the standard Python __invert__ method. |
| public PyObject | __le__(PyObject
the object to compare this with. other)Overrides org. Equivalent to the standard Python __le__ method. |
| public int | __len__()
Overrides org. Equivalent to the standard Python __len__ method. |
| public PyObject | __long__()
Overrides org. Equivalent to the standard Python __long__ method. |
| public PyObject | __lt__(PyObject
the object to compare this with. other)Overrides org. Equivalent to the standard Python __lt__ method. |
| public PyObject | __mod__(PyObject
the object to perform this binary operation with (the right-hand operand). other)Overrides org. Equivalent to the standard Python __mod__ method |
| public PyObject | __mul__(PyObject
the object to perform this binary operation with (the right-hand operand). o)Overrides org. Equivalent to the standard Python __mul__ method. |
| public PyObject | __ne__(PyObject
the object to compare this with. other)Overrides org. Equivalent to the standard Python __ne__ method. |
| public PyObject | __neg__()
Overrides org. Equivalent to the standard Python __neg__ method. |
| public PyObject | __pos__()
Overrides org. Equivalent to the standard Python __pos__ method. |
| public PyString | __repr__()
Overrides org. Equivalent to the standard Python |
| public PyObject | __rmul__(PyObject
the object to perform this binary operation with (the left-hand operand). o)Overrides org. Equivalent to the standard Python __rmul__ method. |
| public PyString | __str__()
Overrides org. Equivalent to the standard Python __str__ method. |
| public Object | __tojava__(Class<?>
the Class to convert this c)PyObject to.Overrides org. Equivalent to the Jython __tojava__ method. |
| public PyUnicode | |
| protected final int | |
| protected final int | |
| protected int | Returns: index of leftmost non-whitespace character orright if they all are.rightmost extent of string search right)Helper for |
| private int | |
| protected int | Returns: index of rightmost non-whitespace character or -1 if they all are.Helper for |
| private int | Returns: index of rightmost character not instripChars or -1 if they all are.specifies set of characters to strip stripChars)Helper for |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| private boolean | |
| protected final String | Returns: a new String, stripped of the whitespace characters/bytesImplementation of Python |
| protected final String | |
| protected final PyString | Returns: PyString (or PyUnicode if this string is one), this string after replacements.to replace where found. oldPiece, String replacement text. newPiece, int maximum number of replacements to make, or -1 meaning all of them. count)Helper common to the Python and Java API for |
| protected final int | |
| protected final PyList | |
| protected final String | Returns: a new String, stripped of the whitespace characters/bytesImplementation of Python |
| protected final String | |
| protected final PyList | |
| protected final String | Returns: a new String, stripped of the whitespace characters/bytesImplementation of Python |
| protected final String | |
| private final String | Returns: transformed byte stringof character (byte) translations (or table, String null)set of characters to remove (or deletechars)null)Helper common to the Python and Java API implementing |
| private BigInteger | |
| public double | |
| public int | |
| public long | |
| public String | |
| private void | |
| public String | |
| public String | |
| private static String | Returns: coerced value or nullto coerce to a String or null obj, String of method name)Return a String equivalent to the argument according to the calling conventions of methods
that accept as a byte string anything bearing the buffer interface, or accept
|
| protected static String | Returns: coerced valueto coerce to a String obj)Return a String equivalent to the argument. |
| private static String | Returns: coerced value ornull if it can't beto coerce to a String obj)Return a Java |
| private PyUnicode | Returns: this as aunicode using the default encoding.Decode this |
| private PyUnicode | |
| private PyComplex | |
| public double | |
| private static double | Returns: non-numeric result (if valid)to convert s)Conversion for non-numeric floats, accepting signed or unsigned "inf" and "nan", in any case. |
| public int | |
| public int | |
| public PyLong | |
| public PyLong | |
| protected String | Returns: the formatted string based on the argumentsto be interpolated into the string args, String[] for the trailing args keywords, MarkupIterator when used nested, null if subject is this enclosingIterator, String PyStringthe format string when value)enclosingIterator is not nullImplements PEP-3101 {}-formatting methods |
| public String | |
| public String | |
| public char | charAt(int
the index of the index)char value to be returnedOverrides org. Implements java. Returns the |
| pack-priv static boolean | Returns: true if and only if every character has a code less than 2^widthstring to test s, int number of bits within which each character must fit (<16) width)Determine whether a Java |
| protected final int | Returns: index if non-negativeto check index)A little helper for converting str.find to str.index that will raise
|
| private static String | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | count(String sub, PyObject start, PyObject end)
Equivalent to |
| public PyString | Returns: instance wrappingstrto wrap str)Create an instance of the same type as this object, from the Java String given as argument. |
| protected PyString | Returns: instance wrappingstrJava string representing the characters (as Java UTF-16). str, boolean is ignored in isBasic)PyString (effectively true).Create an instance of the same type as this object, from the Java String given as argument. |
| public PyObject | |
| public PyObject | |
| public PyObject | |
| public static String | |
| public String | |
| public String | |
| public String | |
| public static String | |
| pack-priv static String | Returns: encoded string (possibly the same string if unchanged)'"' or '\'' use that, '?' = let Python choose, 0 or anything = no quotes quote)The inner logic of the string __repr__ producing an ASCII representation of the target string, optionally in quotations. |
| public boolean | |
| public boolean | Returns: true if this string slice ends with a specified suffix, otherwise
false.string to check for (or a suffix, PyObject PyTuple of them).start of slice. start)Equivalent to the Python |
| public boolean | Returns: true if this string slice ends with a specified suffix, otherwise
false.string to check for (or a suffix, PyObject PyTuple of them).start of slice. start, PyObject end of slice. end)Equivalent to the Python |
| public String | |
| public String | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | find(String sub, PyObject start, PyObject end)
Equivalent to |
| public static PyString | Returns: PyString for those bytesString representing bytesCreates a |
| protected PyString | Returns: new object.first included character. begin, int first excluded character. end)Return a new object of the same type as this one equal to the slice
|
| public synchronized PyBuffer | Returns: the requested bufferconsumer requirements flags)Implements org. Return a read-only buffer view of the contents of the string, treating it as a sequence of unsigned bytes. |
| private static synchronized Pattern | |
| private BaseBuffer | getExistingBuffer(int flags)
Helper for |
| private PyObject | Returns: the object designated ornull.to interpret. fieldName, boolean true if the field name is from a PyString, false for PyUnicode. bytes, PyObject[] argument list (positional then keyword arguments). args, String[] naming the keyword arguments. keywords)Return the object referenced by a given field name, interpreted in the context of the given argument list, containing positional and keyword arguments. |
| private static synchronized Pattern | getFloatPattern()
Return the (lazily) compiled regular expression that matches all valid a Python float() arguments, in which Group 1 captures the number, stripped of white space. |
| public int | |
| protected PyObject | getslice(int
the position of the first element. start, int one more than the position of the last element. stop, int the step size. step)Implements abstract org. Returns a range of elements from the sequence. |
| public String | |
| public int | |
| private static int | hexescape(StringBuilder partialDecode, String errors, int digits, int hexDigitStart, String str, int size, String errorMessage)
|
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | index(String sub, PyObject start, PyObject end)
Equivalent to |
| public String | |
| public boolean | |
| public boolean | |
| public boolean | Returns: trueDetermine whether the string consists entirely of basic-plane characters. |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public PyString | |
| public int | length()
Overrides org. Implements java. Returns the length of this character sequence. |
| public String | |
| public String | |
| public String | |
| public String | Returns: a new String, stripped of the whitespace characters/bytesEquivalent of Python |
| public String | |
| public PyObject | |
| private static String | Returns: the messageproblematic string s)Create the dreaded "non-byte value" error message. |
| private static String | |
| private static char | |
| public PyTuple | Returns: tuple of partsstr, unicode or object implementing sepObj)BufferProtocolEquivalent to Python |
| pack-priv static TextFormatter | Returns: a formatter ready to use, or null if the type is not a string format type.a parsed PEP-3101 format specification. specCommon code for |
| protected PyObject | pyget(int
index of element to return. i)Implements abstract org. Returns the element of the sequence at the given index. |
| private void | renderField(PyObject
to format. fieldObj, String specification to apply. formatSpec, StringBuilder to which the result will be appended. result)Append to a formatting result, the presentation of one object, according to a given format
specification and the object's |
| protected PyObject | repeat(int
the number of times to repeat the sequence. count)Implements abstract org. Returns a (concrete subclass of) PySequence that repeats the given sequence, as in the
implementation of |
| public PyString | Returns: PyString (or PyUnicode if any string is one), this string after replacements.to replace where found. oldPiece, PyObject replacement text. newPiece)Equivalent to Python str.replace(old, new), returning a copy of the string with all occurrences of substring old replaced by new. |
| public PyString | Returns: PyString (or PyUnicode if any string is one), this string after replacements.to replace where found. oldPiece, PyObject replacement text. newPiece, int maximum number of replacements to make, or -1 meaning all of them. count)Equivalent to Python str.replace(old, new[, count]), returning a copy of the string with all occurrences of substring old replaced by new. |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | rfind(String sub, PyObject start, PyObject end)
Equivalent to |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | |
| public int | rindex(String sub, PyObject start, PyObject end)
Equivalent to |
| public String | |
| public PyTuple | Returns: tuple of partsstr, unicode or object implementing sepObj)BufferProtocolEquivalent to Python |
| public PyList | Returns: list(str) resultEquivalent to Python |
| public PyList | |
| public PyList | |
| public PyList | |
| public PyList | Returns: list(str) resultstring to use as separator (or sep, int null if to split on whitespace)maximum number of splits to make (there may be maxsplit)maxsplit+1
parts).As |
| protected PyList | Returns: PyList of split sectionslimit on the number of splits (if >=0) maxsplit)Helper function for |
| private PyList | Returns: PyList of split sectionsat occurrences of which this string should be split sep, int limit on the number of splits (if >=0) maxsplit)Helper function for |
| public String | Returns: a new String, stripped of the whitespace characters/bytesEquivalent of Python |
| public String | |
| public PyObject | |
| public PyList | |
| public PyList | |
| public PyList | |
| public PyList | |
| public PyList | Returns: list(str) resultstring to use as separator (or sep, int null if to split on whitespace)maximum number of splits to make (there may be maxsplit)maxsplit+1
parts).As |
| protected PyList | Returns: PyList of split sectionslimit on the number of splits (if >=0) maxsplit)Helper function for |
| private PyList | Returns: PyList of split sectionsat occurrences of which this string should be split sep, int limit on the number of splits (if >=0) maxsplit)Helper function for |
| public PyList | |
| public PyList | |
| public boolean | Returns: true if this string slice starts with a specified prefix, otherwise
false.string to check for (or a prefix)PyTuple of them).Equivalent to the Python |
| public boolean | Returns: true if this string slice starts with a specified prefix, otherwise
false.string to check for (or a prefix, PyObject PyTuple of them).start of slice. start)Equivalent to the Python |
| public boolean | Returns: true if this string slice starts with a specified prefix, otherwise
false.string to check for (or a prefix, PyObject PyTuple of them).start of slice. start, PyObject end of slice. end)Equivalent to the Python |
| private static boolean | |
| pack-priv final PyObject | |
| pack-priv final int | |
| pack-priv final boolean | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyTuple | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final int | |
| pack-priv final PyObject | |
| pack-priv final int | |
| pack-priv final PyObject | |
| public PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final PyString | |
| pack-priv final PyObject | |
| pack-priv final PyString | |
| pack-priv final PyObject | |
| pack-priv final PyObject | |
| pack-priv final String | |
| pack-priv final String | |
| pack-priv final int | |
| pack-priv final PyObject | |
| pack-priv final String | |
| pack-priv final boolean | |
| pack-priv final String | |
| pack-priv final int | |
| pack-priv final PyObject | |
| pack-priv final int | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final boolean | |
| pack-priv final PyString | |
| pack-priv final String | |
| pack-priv final String | |
| pack-priv final PyObject | |
| pack-priv static PyObject | |
| pack-priv final PyTuple | |
| pack-priv final PyString | |
| pack-priv final int | |
| pack-priv final int | |
| pack-priv final String | |
| pack-priv final PyTuple | |
| pack-priv final PyList | |
| pack-priv final PyObject | |
| pack-priv final PyList | |
| pack-priv final PyList | |
| pack-priv final boolean | |
| pack-priv final PyObject | |
| pack-priv final String | |
| pack-priv final String | |
| pack-priv final String | |
| pack-priv final String | |
| pack-priv final String | |
| public String | Returns: a new String, stripped of the whitespace characters/bytesEquivalent of Python |
| public String | |
| public PyObject | |
| public CharSequence | subSequence(int
the start index, inclusive start, int the end index, exclusive end)Overrides org. Implements java. Returns a |
| public String | Returns: the specified substring.the beginning index, inclusive. start, int the ending index, exclusive. end)Return a substring of this object as a Java String. |
| public String | |
| public String | |
| public byte[] | Returns: a byte array with one byte for each char in this object's underlying String. Each byte contains the low-order bits of its corresponding char.
|
| public int[] | |
| private static double | Returns: value of sto interpret s)Helper for interpreting each part (real and imaginary) of a complex number expressed as a
string in |
| public String | toString()
Overrides org. Implements java. Returns a string containing the characters in this sequence in the same order as this sequence. |
| public String | |
| public String | Returns: transformed byte stringof character (byte) translations (or table, PyObject null)set of characters to remove (or deletechars)null)Equivalent to Python |
| public String | |
| public String | translate(String table, String deletechars)
Equivalent to |
| protected int[] | Returns: a 4 element array of two range-safe indices, and two original indices.Python start of slice startObj, PyObject Python end of slice endObj)Many of the string methods deal with slices specified using Python slice semantics:
endpoints, which are |
| pack-priv final PyUnicode | |
| pack-priv final PyTuple | |
| pack-priv final PyTuple | |
| protected String | unsupportedopMessage(String op, PyObject o2)
Overrides org. Return sequence-specific error messages suitable for substitution. |
| public String | |
| public String |