Package io.deephaven.base.string.cache
Interface StringAlike<TYPE>
- All Superinterfaces:
CharSequence
,Comparable<CharSequence>
,Serializable
,StringCompatible
- All Known Implementing Classes:
AbstractCompressedString
,CompressedString
,MappedCompressedString
This creates an interface (with more permissive argument types, and generified return types) for most public instance
methods of class String.
For static methods, often the String implementation should be used and its results converted to the desired type via
construction. That is, for String method M, and StringAlike class SAC, follow the following pattern: new
SAC(String.M(args...))
For JavaDocs, see
String
.-
Method Summary
Modifier and TypeMethodDescriptionint
codePointAt
(int index) int
codePointBefore
(int index) int
codePointCount
(int beginIndex, int endIndex) int
compareToIgnoreCase
(@NotNull CharSequence that) boolean
contains
(CharSequence cs) boolean
contentEquals
(@NotNull CharSequence cs) boolean
endsWith
(@NotNull CharSequence suffix) boolean
equalsIgnoreCase
(@NotNull CharSequence that) byte[]
getBytes()
void
getChars
(int srcBegin, int srcEnd, char[] dst, int dstBegin) int
indexOf
(int ch) int
indexOf
(int ch, int fromIndex) int
indexOf
(CharSequence cs) int
indexOf
(CharSequence cs, int fromIndex) intern()
boolean
isEmpty()
int
lastIndexOf
(int ch) int
lastIndexOf
(int ch, int fromIndex) int
int
lastIndexOf
(CharSequence cs, int fromIndex) boolean
matches
(CharSequence regex) boolean
regionMatches
(boolean ignoreCase, int offset, CharSequence that, int thatOffset, int length) replace
(char oldChar, char newChar) replace
(CharSequence target, CharSequence replacement) replaceAll
(CharSequence regex, CharSequence replacement) replaceFirst
(CharSequence regex, CharSequence replacement) TYPE[]
split
(CharSequence regex) TYPE[]
split
(CharSequence regex, int limit) boolean
startsWith
(@NotNull CharSequence prefix) boolean
startsWith
(@NotNull CharSequence prefix, int offset) substring
(int beginIndex) substring
(int beginIndex, int endIndex) char[]
toLowerCase
(Locale locale) toUpperCase
(Locale locale) trim()
Methods inherited from interface java.lang.CharSequence
charAt, chars, codePoints, length, subSequence
Methods inherited from interface io.deephaven.base.string.cache.StringCompatible
compareTo, equals, hashCode, toCompressedString, toMappedCompressedString, toString
-
Method Details
-
isEmpty
boolean isEmpty()- Specified by:
isEmpty
in interfaceCharSequence
-
codePointAt
int codePointAt(int index) -
codePointBefore
int codePointBefore(int index) -
codePointCount
int codePointCount(int beginIndex, int endIndex) -
getChars
void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) -
getBytes
byte[] getBytes() -
contentEquals
-
equalsIgnoreCase
-
compareToIgnoreCase
-
regionMatches
boolean regionMatches(boolean ignoreCase, int offset, CharSequence that, int thatOffset, int length) -
startsWith
-
startsWith
-
endsWith
-
indexOf
int indexOf(int ch, int fromIndex) -
indexOf
int indexOf(int ch) -
lastIndexOf
int lastIndexOf(int ch, int fromIndex) -
lastIndexOf
int lastIndexOf(int ch) -
substring
-
substring
-
concat
-
concat
-
matches
-
trim
TYPE trim() -
toCharArray
char[] toCharArray() -
indexOf
-
indexOf
-
lastIndexOf
-
lastIndexOf
-
replace
-
contains
-
replaceFirst
-
replaceAll
-
replace
-
split
-
split
-
toLowerCase
-
toLowerCase
TYPE toLowerCase() -
toUpperCase
-
toUpperCase
TYPE toUpperCase() -
intern
TYPE intern()
-