Package net.sf.saxon.str
Class Latin1
java.lang.Object
net.sf.saxon.str.UnicodeString
net.sf.saxon.str.Twine8
net.sf.saxon.str.Latin1
- All Implemented Interfaces:
Comparable<UnicodeString>,AtomicMatchKey
An implementation of
UnicodeString that subclasses Twine8 (so it is only suitable
for codepoints up to 255), and that also caches a String representing the same characters.
This is wasteful of space, so it is used predominantly for static constants.-
Field Summary
Fields inherited from class net.sf.saxon.str.Twine8
bytes, cachedHash -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(UnicodeString other) Compare this string to another using codepoint comparisonbooleanTest whether this StringValue is equal to another under the rules of the codepoint collation.static Latin1Wrap a String, which must contain no surrogatestoString()Display as a string.Methods inherited from class net.sf.saxon.str.Twine8
codePointAt, codePoints, details, getByteArray, getWidth, hashCode, indexOf, indexOf, indexWhere, isEmpty, iterate, length, length32, substringMethods inherited from class net.sf.saxon.str.UnicodeString
asAtomic, checkSubstringBounds, concat, economize, estimatedLength, fromLong, hasSubstring, indexOf, longHashCode, prefix, requireInt, requireNonNegativeInt, substring, tidy
-
Constructor Details
-
Latin1
Protected constructor- Parameters:
baseString- the string to be wrapped: the caller is responsible for ensuring this contains no codepoints above 255
-
-
Method Details
-
of
Wrap a String, which must contain no surrogates- Parameters:
base- the string. The caller warrants that this string contains no surrogates; this condition is checked only if Java assertions are enabled.- Returns:
- the wrapped string.
-
compareTo
Description copied from class:UnicodeStringCompare this string to another using codepoint comparison- Specified by:
compareToin interfaceComparable<UnicodeString>- Overrides:
compareToin classTwine8- Parameters:
other- the other string- Returns:
- -1 if this string comes first, 0 if they are equal, +1 if the other string comes first
-
equals
Description copied from class:Twine8Test whether this StringValue is equal to another under the rules of the codepoint collation. The type annotation is ignored. -
toString
Description copied from class:Twine8Display as a string.
-