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
ConstructorsConstructorDescriptionCompressedString(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 CompressedStringHelper to be statically imported for groovy scripting.protected final CompressedStringconvertValue(byte[] data, int offset, int length) Convert a byte array to this type, assuming ISO-8859-1protected final CompressedStringconvertValue(String string) Convert a String to this type.@NotNull CompressedStringConvert this StringCompatible into a CompressedString.@NotNull MappedCompressedStringConvert 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, trimMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:StringCompatibleConvert 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:StringCompatibleConvert 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:AbstractCompressedStringConvert a String to this type.- Specified by:
convertValuein 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:AbstractCompressedStringConvert a byte array to this type, assuming ISO-8859-1- Specified by:
convertValuein 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
-