| Modifier and Type | Field and Description |
|---|---|
| protected int | m_hash
cached hash code |
| pack-priv int | m_length
The length of the string. |
| pack-priv int | m_start
The start position in the fsb. |
| protected String | m_strCache
If the str() function is called, the string will be cached here. |
| pack-priv static final long |
| Access | Constructor and Description |
|---|---|
| public | XStringForFSB(FastStringBuffer
FastStringBuffer object this will wrap, must be non-null. val, int The start position in the array. start, int The number of characters to read from the array. length)Construct a XNodeSet object. |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | Returns: The string this wraps or the empty string if nullOverrides com. Cast result object to a string. |
| public char | Returns: the character at the specified index of this string. The first character is at index0.the index of the character. index)Overrides com. Implements com. Returns the character at the specified index. |
| public int | Returns: the value0 if the argument string is equal to
this string; a value less than 0 if this string
is lexicographically less than the string argument; and a
value greater than 0 if this string is
lexicographically greater than the string argument.the xstr)String to be compared.Overrides com. Implements com. Compares two strings lexicographically. |
| public int | Returns: a negative integer, zero, or a positive integer as the the specified String is greater than, equal to, or less than this String, ignoring case considerations.the xstr)String to be compared.Overrides com. Implements com. Compares two strings lexicographically, ignoring case considerations. |
| public XMLString | Returns: a string that represents the concatenation of this object's characters followed by the string argument's characters.the str)String that is concatenated to the end
of this String.Overrides com. Implements com. Concatenates the specified string to the end of this string. |
| public void | dispatchAsComment(LexicalHandler
A non-null reference to a LexicalHandler. lh)Overrides com. Implements com. Directly call the comment method on the passed LexicalHandler for the string-value. |
| public void | dispatchCharactersEvents(ContentHandler
A non-null reference to a ContentHandler. ch)Overrides com. Implements com. Directly call the characters method on the passed ContentHandler for the string-value. |
| public boolean | Returns: true if the String are equal;
false otherwise.the object to compare this obj2)String
against.Overrides com. Implements com. Compares this string to the specified object. |
| public boolean | Returns: true if the two objects are equalObject to compare this to obj2)Overrides com. Tell if two objects are functionally equal. |
| public boolean | Returns: true if the two objects are equalObject to compare this to anotherString)Overrides com. Implements com. Tell if two objects are functionally equal. |
| public boolean | Returns: true if the String are equal;
false otherwise.the object to compare this obj2)String
against.Overrides com. Implements com. Compares this string to the specified object. |
| public boolean | Returns: true if the argument is not null
and the Strings are equal,
ignoring case; false otherwise.the anotherString)String to compare this
String against.Overrides com. Implements com. Compares this |
| public XMLString | Returns: The trimmed string.Trim leading whitespace? trimHead, boolean Trim trailing whitespace? trimTail, boolean Use double spaces for punctuation? doublePunctuationSpaces)Overrides com. Implements com. Conditionally trim all leading and trailing whitespace in the specified String. |
| public FastStringBuffer | |
| public void | getChars(int
index of the first character in the string
to copy. srcBegin, int index after the last character in the string
to copy. srcEnd, char[] the destination array. dst, int the start offset in the destination array. dstBegin)Overrides com. Implements com. Copies characters from this string into the destination character array. |
| public int | Returns: a hash code value for this object.Overrides com. Implements com. Returns a hashcode for this string. |
| public boolean | Returns: true if this XMLString can return a string without creating one.Overrides com. Implements com. Tell if this object contains a java String object. |
| public int | Returns: the index of the first occurrence of the character in the character sequence represented by this object, or-1 if the character does not occur.a character. ch)Overrides com. Implements com. Returns the index within this string of the first occurrence of the specified character. |
| public int | Returns: the index of the first occurrence of the character in the character sequence represented by this object that is greater than or equal tofromIndex, or -1
if the character does not occur.a character. ch, int the index to start the search from. fromIndex)Overrides com. Implements com. Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index. |
| private static boolean | Returns: =true if ch is XML whitespace; otherwise =false.Character to check as XML whitespace. ch)Hides com. Returns whether the specified ch conforms to the XML 1.0 definition of whitespace. |
| public int | Returns: the length of the sequence of characters represented by this object.Overrides com. Implements com. Returns the length of this string. |
| public Object | Returns: The java String representation of this object.Overrides com. Since this object is incomplete without the length and the offset, we have to convert to a string when this function is called. |
| public boolean | Returns: true if the character sequence represented by the
argument is a prefix of the substring of this object starting
at index toffset; false otherwise.
The result is false if toffset is
negative or greater than the length of this
String object; otherwise the result is the same
as the result of the expression
this.subString(toffset).startsWith(prefix)
the prefix. prefix, int where to begin looking in the string. toffset)Overrides com. Implements com. Tests if this string starts with the specified prefix beginning a specified index. |
| public boolean | Returns: true if the character sequence represented by the
argument is a prefix of the character sequence represented by
this string; false otherwise.
Note also that true will be returned if the
argument is an empty string or is equal to this
String object as determined by the
equals(Object) method.the prefix. prefix)Overrides com. Implements com. Tests if this string starts with the specified prefix. |
| public String | Returns: The string this wraps or the empty string if nullOverrides com. Cast result object to a string. |
| public XMLString | Returns: the specified substring.the beginning index, inclusive. beginIndex)Overrides com. Implements com. Returns a new string that is a substring of this string. |
| public XMLString | Returns: the specified substring.the beginning index, inclusive. beginIndex, int the ending index, exclusive. endIndex)Overrides com. Implements com. Returns a new string that is a substring of this string. |
| public double | Returns: A double value representation of the string, or return Double.NaN if the string can not be converted.Overrides com. Implements com. Convert a string to a double -- Allowed input is in fixed notation ddd.fff. |
| public XMLString | Returns: this string, with white space removed from the front and end.Overrides com. Implements com. Removes white space from both ends of this string. |
| m_hash | back to summary |
|---|---|
| protected int m_hash cached hash code | |
| m_length | back to summary |
|---|---|
| pack-priv int m_length The length of the string. | |
| m_start | back to summary |
|---|---|
| pack-priv int m_start The start position in the fsb. | |
| m_strCache | back to summary |
|---|---|
| protected String m_strCache If the str() function is called, the string will be cached here. | |
| serialVersionUID | back to summary |
|---|---|
| pack-priv static final long serialVersionUID Hides com. | |
| XStringForFSB | back to summary |
|---|---|
| public XStringForFSB(FastStringBuffer val, int start, int length) Construct a XNodeSet object.
| |
| XStringForFSB | back to summary |
|---|---|
| private XStringForFSB(String val) Construct a XNodeSet object.
| |
| appendToFsb | back to summary |
|---|---|
| public void appendToFsb(FastStringBuffer fsb) Overrides com. Cast result object to a string.
| |
| charAt | back to summary |
|---|---|
| public char charAt(int index) Overrides com. Implements com. Returns the character at the specified index. An index ranges
from
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(XMLString xstr) Overrides com. Implements com. Compares two strings lexicographically.
| |
| compareToIgnoreCase | back to summary |
|---|---|
| public int compareToIgnoreCase(XMLString xstr) Overrides com. Implements com. Compares two strings lexicographically, ignoring case considerations.
This method returns an integer whose sign is that of
Note that this method does not take locale into account, and will result in an unsatisfactory ordering for certain locales. The java.text package provides collators to allow locale-sensitive ordering.
| |
| concat | back to summary |
|---|---|
| public XMLString concat(String str) Overrides com. Implements com. Concatenates the specified string to the end of this string.
| |
| dispatchAsComment | back to summary |
|---|---|
| public void dispatchAsComment(LexicalHandler lh) throws SAXException Overrides com. Implements com. Directly call the comment method on the passed LexicalHandler for the string-value.
| |
| dispatchCharactersEvents | back to summary |
|---|---|
| public void dispatchCharactersEvents(ContentHandler ch) throws SAXException Overrides com. Implements com. Directly call the characters method on the passed ContentHandler for the string-value. Multiple calls to the ContentHandler's characters methods may well occur for a single call to this method.
| |
| equals | back to summary |
|---|---|
| public boolean equals(XMLString obj2) Overrides com. Implements com. Compares this string to the specified object.
The result is
| |
| equals | back to summary |
|---|---|
| public boolean equals(XObject obj2) Overrides com. Tell if two objects are functionally equal.
| |
| equals | back to summary |
|---|---|
| public boolean equals(String anotherString) Overrides com. Implements com. Tell if two objects are functionally equal.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj2) Overrides com. Implements com. Compares this string to the specified object.
The result is
| |
| equalsIgnoreCase | back to summary |
|---|---|
| public boolean equalsIgnoreCase(String anotherString) Overrides com. Implements com. Compares this
| |
| fixWhiteSpace | back to summary |
|---|---|
| public XMLString fixWhiteSpace(boolean trimHead, boolean trimTail, boolean doublePunctuationSpaces) Overrides com. Implements com. Conditionally trim all leading and trailing whitespace in the specified String. All strings of white space are replaced by a single space character (#x20), except spaces after punctuation which receive double spaces if doublePunctuationSpaces is true. This function may be useful to a formatter, but to get first class results, the formatter should probably do it's own white space handling based on the semantics of the formatting object.
| |
| fsb | back to summary |
|---|---|
| public FastStringBuffer fsb() Cast result object to a string.
| |
| getChars | back to summary |
|---|---|
| public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin) Overrides com. Implements com. Copies characters from this string into the destination character array.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides com. Implements com. Returns a hashcode for this string. The hashcode for a
usings[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] int arithmetic, where s[i] is the
ith character of the string, n is the length of
the string, and ^ indicates exponentiation.
(The hash value of the empty string is zero.)
| |
| hasString | back to summary |
|---|---|
| public boolean hasString() Overrides com. Implements com. Tell if this object contains a java String object.
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(int ch) Overrides com. Implements com. Returns the index within this string of the first occurrence of the
specified character. If a character with value isthis.charAt(k) == ch true. If no such character occurs in this string,
then -1 is returned.
| |
| indexOf | back to summary |
|---|---|
| public int indexOf(int ch, int fromIndex) Overrides com. Implements com. Returns the index within this string of the first occurrence of the specified character, starting the search at the specified index.
If a character with value is true. If no such character occurs in this string at or after position(this.charAt(k) == ch) && (k >= fromIndex) fromIndex, then -1 is returned.
There is no restriction on the value of
| |
| isSpace | back to summary |
|---|---|
| private static boolean isSpace(char ch) Hides com. Returns whether the specified ch conforms to the XML 1.0 definition
of whitespace. Refer to
the definition of
| |
| length | back to summary |
|---|---|
| public int length() Overrides com. Implements com. Returns the length of this string.
| |
| object | back to summary |
|---|---|
| public Object object() Overrides com. Since this object is incomplete without the length and the offset, we have to convert to a string when this function is called.
| |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(XMLString prefix, int toffset) Overrides com. Implements com. Tests if this string starts with the specified prefix beginning a specified index.
| |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(XMLString prefix) Overrides com. Implements com. Tests if this string starts with the specified prefix.
| |
| str | back to summary |
|---|---|
| public String str() Overrides com. Cast result object to a string.
| |
| substring | back to summary |
|---|---|
| public XMLString substring(int beginIndex) Overrides com. Implements com. Returns a new string that is a substring of this string. The substring begins with the character at the specified index and extends to the end of this string. Examples: "unhappy".substring(2) returns "happy" "Harbison".substring(3) returns "bison" "emptiness".substring(9) returns "" (an empty string)
| |
| substring | back to summary |
|---|---|
| public XMLString substring(int beginIndex, int endIndex) Overrides com. Implements com. Returns a new string that is a substring of this string. The
substring begins at the specified
| |
| toDouble | back to summary |
|---|---|
| public double toDouble() Overrides com. Implements com. Convert a string to a double -- Allowed input is in fixed notation ddd.fff. %OPT% CHECK PERFORMANCE against generating a Java String and converting it to double. The advantage of running in native machine code -- perhaps even microcode, on some systems -- may more than make up for the cost of allocating and discarding the additional object. We need to benchmark this. %OPT% More importantly, we need to decide whether we _care_ about the performance of this operation. Does XString.toDouble constitute any measurable percentage of our typical runtime? I suspect not!
| |
| trim | back to summary |
|---|---|
| public XMLString trim() Overrides com. Implements com. Removes white space from both ends of this string.
| |