Caution
Since this class is mutable, it must not be used anywhere that an immutable object is required, like in a cache or as the key of a hash map.
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private boolean | |
| private int | |
| private final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | adjustOffsetByCodePoint()
Adjusts the offset by the width of the current lead code point, either 1 or 2 chars. |
| public String | |
| public char | charAt(int
the index of the index)char value to be returnedImplements java. char value at the specified index.
|
| public int | |
| private static final boolean | |
| public boolean | contentEquals(CharSequence other)
Returns true if this segment contains the same characters as the other CharSequence. |
| public int | getCaseSensitivePrefixLength(CharSequence other)
Like |
| public int | |
| public int | getCommonPrefixLength(CharSequence other)
Returns the length of the prefix shared by this StringSegment and the given CharSequence. |
| public int | |
| private int | |
| public int | |
| public void | |
| public void | |
| public void | |
| public boolean | startsWith(int otherCp)
Returns true if the first code point of this StringSegment equals the given code point. |
| public boolean | startsWith(UnicodeSet uniset)
Returns true if the first code point of this StringSegment is in the given UnicodeSet. |
| public boolean | startsWith(CharSequence other)
Returns true if there is at least one code point of overlap between this StringSegment and the given CharSequence. |
| public CharSequence | subSequence(int
the start index, inclusive start, int the end index, exclusive end)Implements java. CharSequence that is a subsequence of this sequence.
|
| public String | toString()
Overrides java. Implements java. |
| end | back to summary |
|---|---|
| private int end | |
| foldCase | back to summary |
|---|---|
| private boolean foldCase | |
| start | back to summary |
|---|---|
| private int start | |
| str | back to summary |
|---|---|
| private final String str | |
| StringSegment | back to summary |
|---|---|
| public StringSegment(String str, boolean foldCase) | |
| adjustOffset | back to summary |
|---|---|
| public void adjustOffset(int delta) Equivalent to Number parsing note: This method is usually called by a Matcher to register that a char was consumed. If the char is strong (it usually is, except for things like whitespace), follow this with a call to ParsedNumber#setCharsConsumed(). For more information on strong chars, see that method. | |
| adjustOffsetByCodePoint | back to summary |
|---|---|
| public void adjustOffsetByCodePoint() Adjusts the offset by the width of the current lead code point, either 1 or 2 chars. | |
| asString | back to summary |
|---|---|
| public String asString() Returns a String that is equivalent to the CharSequence representation. | |
| charAt | back to summary |
|---|---|
| public char charAt(int index) Implements java. Doc from java. Returns the If the
| |
| codePointAt | back to summary |
|---|---|
| public int codePointAt(int index) Returns the code point at the given index relative to the current offset. | |
| codePointsEqual | back to summary |
|---|---|
| private static final boolean codePointsEqual(int cp1, int cp2, boolean foldCase) | |
| contentEquals | back to summary |
|---|---|
| public boolean contentEquals(CharSequence other) Returns true if this segment contains the same characters as the other CharSequence. This method does not perform case folding; if you want case-insensitive equality, use
| |
| getCaseSensitivePrefixLength | back to summary |
|---|---|
| public int getCaseSensitivePrefixLength(CharSequence other) Like | |
| getCodePoint | back to summary |
|---|---|
| public int getCodePoint() Returns the first code point in the string segment. Important Note Most of the time, you should use | |
| getCommonPrefixLength | back to summary |
|---|---|
| public int getCommonPrefixLength(CharSequence other) Returns the length of the prefix shared by this StringSegment and the given CharSequence. For example, if this string segment is "aab", and the char sequence is "aac", this method returns 2, since the first 2 characters are the same. This method only returns offsets along code point boundaries. This method will perform case folding if case folding was enabled in the constructor. Important Note The given CharSequence must not be empty! It is the caller's responsibility to check. | |
| getOffset | back to summary |
|---|---|
| public int getOffset() | |
| getPrefixLengthInternal | back to summary |
|---|---|
| private int getPrefixLengthInternal(CharSequence other, boolean foldCase) | |
| length | back to summary |
|---|---|
| public int length() Implements java. Doc from java. Returns the length of this character sequence. The length is the number
of 16-bit
| |
| resetLength | back to summary |
|---|---|
| public void resetLength() | |
| setLength | back to summary |
|---|---|
| public void setLength(int length) | |
| setOffset | back to summary |
|---|---|
| public void setOffset(int start) | |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(int otherCp) Returns true if the first code point of this StringSegment equals the given code point. This method will perform case folding if case folding is enabled for the parser. | |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(UnicodeSet uniset) Returns true if the first code point of this StringSegment is in the given UnicodeSet. | |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(CharSequence other) Returns true if there is at least one code point of overlap between this StringSegment and the given CharSequence. Null-safe. | |
| subSequence | back to summary |
|---|---|
| public CharSequence subSequence(int start, int end) Implements java. Doc from java. Returns a
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements java. Returns a string representation useful for debugging.
| |