public class PDStyledString
extends java.lang.Object
implements java.lang.CharSequence
| Modifier and Type | Class and Description |
|---|---|
static class |
PDStyledString.Builder |
static class |
PDStyledString.StylePart |
| Constructor and Description |
|---|
PDStyledString(java.lang.CharSequence str,
PDTextStyle style) |
| Modifier and Type | Method and Description |
|---|---|
char |
charAt(int index) |
protected static PDStyledString |
getPdStyledSubstring(java.lang.CharSequence string,
java.util.Collection<PDStyledString.StylePart> styleParts,
int start,
int end) |
PDStyledString.StylePart[] |
getStyle() |
java.lang.String |
getText() |
int |
indexOf(int ch)
Returns the index within this string of the first occurrence of
the specified character.
|
int |
indexOf(int ch,
int fromIndex)
Returns the index within this string of the first occurrence of the
specified character, starting the search at the specified index.
|
int |
length() |
PDStyledString[] |
split(char separator) |
PDStyledString |
subSequence(int start,
int end) |
java.lang.String |
toString() |
public PDStyledString(java.lang.CharSequence str,
PDTextStyle style)
public PDStyledString.StylePart[] getStyle()
public java.lang.String getText()
public int length()
length in interface java.lang.CharSequencepublic char charAt(int index)
charAt in interface java.lang.CharSequencepublic PDStyledString subSequence(int start, int end)
subSequence in interface java.lang.CharSequencepublic java.lang.String toString()
toString in interface java.lang.CharSequencetoString in class java.lang.Objectpublic int indexOf(int ch)
ch occurs in the character sequence represented by
this String object, then the index (in Unicode
code units) of the first such occurrence is returned. For
values of ch in the range from 0 to 0xFFFF
(inclusive), this is the smallest value k such that:
is true. For other values ofthis.charAt(k) == ch
ch, it is the
smallest value k such that:
is true. In either case, if no such character occurs in this string, thenthis.codePointAt(k) == ch
-1 is returned.ch - a character (Unicode code point).-1 if the character does not occur.public int indexOf(int ch,
int fromIndex)
If a character with value ch occurs in the
character sequence represented by this String
object at an index no smaller than fromIndex, then
the index of the first such occurrence is returned. For values
of ch in the range from 0 to 0xFFFF (inclusive),
this is the smallest value k such that:
is true. For other values of(this.charAt(k) == ch)&&(k >= fromIndex)
ch, it is the
smallest value k such that:
is true. In either case, if no such character occurs in this string at or after position(this.codePointAt(k) == ch)&&(k >= fromIndex)
fromIndex, then
-1 is returned.
There is no restriction on the value of fromIndex. If it
is negative, it has the same effect as if it were zero: this entire
string may be searched. If it is greater than the length of this
string, it has the same effect as if it were equal to the length of
this string: -1 is returned.
All indices are specified in char values
(Unicode code units).
ch - a character (Unicode code point).fromIndex - the index to start the search from.fromIndex, or -1
if the character does not occur.public PDStyledString[] split(char separator)
protected static PDStyledString getPdStyledSubstring(java.lang.CharSequence string, java.util.Collection<PDStyledString.StylePart> styleParts, int start, int end)