|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.lang.StringRedirects
public class StringRedirects
Contains methods added to java.lang.String in 1.5. Strings in 1.4 don't know about surrogate pairs and the difference between code points and chars, so for now just treat characters as if they were code points.
Constructor Summary | |
---|---|
StringRedirects()
|
Method Summary | |
---|---|
static JBossStringBuilder |
appendCodePoint(JBossStringBuilder builder,
int codePoint)
|
static StringBuffer |
appendCodePoint(StringBuffer buffer,
int codePoint)
|
static int |
codePointAt(JBossStringBuilder builder,
int index)
|
static int |
codePointAt(StringBuffer buffer,
int index)
|
static int |
codePointAt(String string,
int index)
Returns the character (Unicode code point) at the specified index. |
static int |
codePointBefore(JBossStringBuilder builder,
int index)
|
static int |
codePointBefore(StringBuffer buffer,
int index)
|
static int |
codePointBefore(String string,
int index)
Returns the character (Unicode code point) just before the specified index. |
static int |
codePointCount(JBossStringBuilder builder,
int beginIndex,
int endIndex)
|
static int |
codePointCount(StringBuffer buffer,
int beginIndex,
int endIndex)
|
static int |
codePointCount(String string,
int beginIndex,
int endIndex)
Returns the number of code points between in the specified range. |
static boolean |
contains(String string,
CharSequence s)
Whether the string contains the character sequence |
static int |
offsetByCodePoints(JBossStringBuilder builder,
int index,
int codePointOffset)
|
static int |
offsetByCodePoints(StringBuffer buffer,
int index,
int codePointOffset)
|
static int |
offsetByCodePoints(String string,
int index,
int codePointOffset)
Returns the index within this String that is offset from the given index by codePointOffset code points. |
static String |
quoteReplacement(String string)
Quote the replacement string |
static String |
replace(String string,
CharSequence target,
CharSequence replacement)
Replace a character sequence |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringRedirects()
Method Detail |
---|
public static String replace(String string, CharSequence target, CharSequence replacement)
string
- the stringtarget
- the string to replacereplacement
- the replacement text
public static boolean contains(String string, CharSequence s)
string
- the strings
- the character sequence
public static String quoteReplacement(String string)
string
- the quoted stringpublic static int codePointAt(String string, int index)
string
- the string to examineindex
- the code point index
IndexOutOfBoundsException
- if the index argument is less than zero or
beyond the end of the stringpublic static int codePointBefore(String string, int index)
string
- the string to examineindex
- the code point index
IndexOutOfBoundsException
- if the index argument is less than one or
beyond the end of the stringpublic static int codePointCount(String string, int beginIndex, int endIndex)
string
- the string to examinebeginIndex
- the code point index to start atendIndex
- the code point index to end at
IndexOutOfBoundsException
- if the beginIndex is negative, or endIndex
is larger than the length of this String, or beginIndex is larger than endIndex.public static int offsetByCodePoints(String string, int index, int codePointOffset)
string
- the string to examineindex
- the index to be offsetcodePointOffset
- the offset in code points
IndexOutOfBoundsException
- if index is negative or larger then the length of this String,
or if codePointOffset is positive and the substring starting with index has fewer than
codePointOffset code points, or if codePointOffset is negative and the substring before
index has fewer than the absolute value of codePointOffset code points.public static StringBuffer appendCodePoint(StringBuffer buffer, int codePoint)
public static int codePointAt(StringBuffer buffer, int index)
public static int codePointBefore(StringBuffer buffer, int index)
public static int codePointCount(StringBuffer buffer, int beginIndex, int endIndex)
public static int offsetByCodePoints(StringBuffer buffer, int index, int codePointOffset)
public static JBossStringBuilder appendCodePoint(JBossStringBuilder builder, int codePoint)
public static int codePointAt(JBossStringBuilder builder, int index)
public static int codePointBefore(JBossStringBuilder builder, int index)
public static int codePointCount(JBossStringBuilder builder, int beginIndex, int endIndex)
public static int offsetByCodePoints(JBossStringBuilder builder, int index, int codePointOffset)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |