Package io.deephaven.base.string.cache
Class CompressedString
java.lang.Object
io.deephaven.base.string.cache.AbstractCompressedString<CompressedString>
io.deephaven.base.string.cache.CompressedString
- All Implemented Interfaces:
StringAlike<CompressedString>
,StringCompatible
,Serializable
,CharSequence
,Comparable<CharSequence>
Immutable byte[]-backed String replacement.
- See Also:
-
Constructor Summary
ConstructorDescriptionCompressedString
(byte[] data) CompressedString
(byte[] data, int offset, int length) CompressedString
(char[] data) CompressedString
(char[] data, int offset, int length) CompressedString
(String data) CompressedString
(ByteBuffer data) CompressedString
(ByteBuffer data, int offset, int length) -
Method Summary
Modifier and TypeMethodDescriptionstatic CompressedString
Helper to be statically imported for groovy scripting.protected final CompressedString
convertValue
(byte[] data, int offset, int length) Convert a byte array to this type, assuming ISO-8859-1protected final CompressedString
convertValue
(String string) Convert a String to this type.@NotNull CompressedString
Convert this StringCompatible into a CompressedString.@NotNull MappedCompressedString
Convert this StringCompatible into a MappedCompressedString.Methods inherited from class io.deephaven.base.string.cache.AbstractCompressedString
charAt, codePointAt, codePointBefore, codePointCount, compareTo, compareToIgnoreCase, concat, concat, contains, contentEquals, endsWith, equals, equalsIgnoreCase, getBytes, getChars, getData, hashCode, indexOf, indexOf, indexOf, indexOf, intern, isEmpty, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, length, matches, regionMatches, replace, replace, replaceAll, replaceFirst, split, split, startsWith, startsWith, subSequence, substring, substring, toCharArray, toLowerCase, toLowerCase, toString, toUpperCase, toUpperCase, trim
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
Constructor Details
-
CompressedString
public CompressedString() -
CompressedString
-
CompressedString
public CompressedString(char[] data, int offset, int length) -
CompressedString
public CompressedString(char[] data) -
CompressedString
-
CompressedString
-
CompressedString
public CompressedString(byte[] data, int offset, int length) -
CompressedString
public CompressedString(byte[] data)
-
-
Method Details
-
toCompressedString
Description copied from interface:StringCompatible
Convert this StringCompatible into a CompressedString. Implementations should not cache result CompressedStrings, in order to avoid inadvertently allowing promotion of short-lived objects under generational garbage collection.- Returns:
- A newly constructed CompressedString representing the same sequence of characters as this StringCompatible (or this object, if appropriate).
-
toMappedCompressedString
Description copied from interface:StringCompatible
Convert this StringCompatible into a MappedCompressedString. Implementations should not cache result CompressedStrings, in order to avoid inadvertently allowing promotion of short-lived objects under generational garbage collection.- Returns:
- A newly constructed MappedCompressedString representing the same sequence of characters as this StringCompatible (or this object, if appropriate).
-
convertValue
Description copied from class:AbstractCompressedString
Convert a String to this type.- Specified by:
convertValue
in classAbstractCompressedString<CompressedString>
- Parameters:
string
- The String to convert- Returns:
- A new TYPE with the same contents as String, assuming ISO-8859-1 encoding
-
convertValue
Description copied from class:AbstractCompressedString
Convert a byte array to this type, assuming ISO-8859-1- Specified by:
convertValue
in classAbstractCompressedString<CompressedString>
- Parameters:
data
- The data to convertoffset
- The starting index from data to convertlength
- The length to convert- Returns:
- A new TYPE with the same contents as the specified region of data, assuming ISO-8859-1 encoding
-
compress
Helper to be statically imported for groovy scripting.- Parameters:
value
- The String to convert- Returns:
- A new CompressedString with the same contents as value, assuming ISO-8859-1 encoding
-