public class CompressedWhitespace extends WhitespaceString
Constructor and Description |
---|
CompressedWhitespace(long compressedValue) |
Modifier and Type | Method and Description |
---|---|
int |
codePointAt(long index)
Get the code point at a given position in the string
|
IntIterator |
codePoints()
Get an iterator over the code points present in the string.
|
static UnicodeString |
compressWS(char[] in,
int start,
int len) |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
long |
getCompressedValue() |
int |
hashCode()
Compute a hashCode.
|
long |
length()
Get the length of the string
|
static int |
length(long value) |
int |
length32()
Get the length of the string, provided it is less than 2^31 characters
|
UnicodeString |
uncompress()
Uncompress the whitespace to a (normal) UnicodeString
|
static UnicodeString |
uncompress(long value) |
void |
write(UnicodeWriter writer)
Write the value to a Writer
|
void |
writeEscape(boolean[] specialChars,
UnicodeWriter writer)
Write the value to a Writer with escaping of special characters
|
getWidth, indexOf, substring, toString
asAtomic, checkSubstringBounds, compareTo, concat, economize, estimatedLength, hasSubstring, indexOf, indexOf, indexWhere, isEmpty, prefix, requireInt, substring, tidy, verifyCharacters
public static UnicodeString compressWS(char[] in, int start, int len)
public UnicodeString uncompress()
uncompress
in class WhitespaceString
public static UnicodeString uncompress(long value)
public long getCompressedValue()
public long length()
UnicodeString
length
in class UnicodeString
public int length32()
UnicodeString
length32
in class UnicodeString
int
public static int length(long value)
public int codePointAt(long index)
codePointAt
in class UnicodeString
index
- the given position (0-based)java.lang.IndexOutOfBoundsException
- if the index is out of rangepublic IntIterator codePoints()
UnicodeString
codePoints
in class UnicodeString
public boolean equals(java.lang.Object obj)
equals
in class UnicodeString
public int hashCode()
UnicodeString
UnicodeString
use compatible hash codes and the
hashing algorithm is therefore identical to that for java.lang.String
. This means
that for strings containing Astral characters, the hash code needs to be computed by decomposing
an Astral character into a surrogate pair.hashCode
in class UnicodeString
public void write(UnicodeWriter writer) throws java.io.IOException
write
in class WhitespaceString
writer
- the writer to write tojava.io.IOException
- if an error occurs downstreampublic void writeEscape(boolean[] specialChars, UnicodeWriter writer) throws java.io.IOException
writeEscape
in class WhitespaceString
specialChars
- identifies which characters are considered specialwriter
- the writer to write tojava.io.IOException
- if an error occurs downstreamCopyright (c) 2004-2022 Saxonica Limited. All rights reserved.