| java.lang.Object org.apache.jasper.xmlparser.XMLString
All known Subclasses: org.apache.jasper.xmlparser.XMLStringBuffer,
XMLString | public class XMLString (Code) | | This class is used as a structure to pass text contained in the underlying
character buffer of the scanner. The offset and length fields allow the
buffer to be re-used without creating new character arrays.
Note: Methods that are passed an XMLString structure
should consider the contents read-only and not make any modifications
to the contents of the buffer. The method receiving this structure
should also not modify the offset and length if this structure (or
the values of this structure) are passed to another method.
Note: Methods that are passed an XMLString structure
are required to copy the information out of the buffer if it is to be
saved for use beyond the scope of the method. The contents of the
structure are volatile and the contents of the character buffer cannot
be assured once the method that is passed this structure returns.
Therefore, methods passed this structure should not save any reference
to the structure or the character array contained in the structure.
author: Eric Ye, IBM author: Andy Clark, IBM version: $Id: XMLString.java 467222 2006-10-24 03:17:11Z markt $ |
Field Summary | |
public char[] | ch The character array. | public int | length The length of characters from the offset. | public int | offset The offset into the character array. |
Constructor Summary | |
public | XMLString() Default constructor. | public | XMLString(char[] ch, int offset, int length) Constructs an XMLString structure preset with the specified
values. | public | XMLString(XMLString string) Constructs an XMLString structure with copies of the values in
the given structure. |
Method Summary | |
public void | clear() Resets all of the values to their defaults. | public boolean | equals(char[] ch, int offset, int length) Returns true if the contents of this XMLString structure and
the specified array are equal. | public boolean | equals(String s) Returns true if the contents of this XMLString structure and
the specified string are equal. | public void | setValues(char[] ch, int offset, int length) Initializes the contents of the XMLString structure with the
specified values. | public void | setValues(XMLString s) Initializes the contents of the XMLString structure with copies
of the given string structure. | public String | toString() Returns a string representation of this object. |
ch | public char[] ch(Code) | | The character array.
|
length | public int length(Code) | | The length of characters from the offset.
|
offset | public int offset(Code) | | The offset into the character array.
|
XMLString | public XMLString()(Code) | | Default constructor.
|
XMLString | public XMLString(char[] ch, int offset, int length)(Code) | | Constructs an XMLString structure preset with the specified
values.
Parameters: ch - The character array. Parameters: offset - The offset into the character array. Parameters: length - The length of characters from the offset. |
XMLString | public XMLString(XMLString string)(Code) | | Constructs an XMLString structure with copies of the values in
the given structure.
Note: This does not copy the character array;
only the reference to the array is copied.
Parameters: string - The XMLString to copy. |
clear | public void clear()(Code) | | Resets all of the values to their defaults.
|
equals | public boolean equals(char[] ch, int offset, int length)(Code) | | Returns true if the contents of this XMLString structure and
the specified array are equal.
Parameters: ch - The character array. Parameters: offset - The offset into the character array. Parameters: length - The length of characters from the offset. |
equals | public boolean equals(String s)(Code) | | Returns true if the contents of this XMLString structure and
the specified string are equal.
Parameters: s - The string to compare. |
setValues | public void setValues(char[] ch, int offset, int length)(Code) | | Initializes the contents of the XMLString structure with the
specified values.
Parameters: ch - The character array. Parameters: offset - The offset into the character array. Parameters: length - The length of characters from the offset. |
setValues | public void setValues(XMLString s)(Code) | | Initializes the contents of the XMLString structure with copies
of the given string structure.
Note: This does not copy the character array;
only the reference to the array is copied.
Parameters: s - |
toString | public String toString()(Code) | | Returns a string representation of this object.
|
|
|