Top Description Fields Constructors Methods
org.apache.xerces.xni

public Class XMLString

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.xerces.util.XMLStringBuffer

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.

Authors
Eric Ye, IBM, Andy Clark, IBM
Version
$Id: XMLString.java 447247 2006-09-18 05:23:52Z mrglavas $

Field Summary

Modifier and TypeField and Description
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

AccessConstructor and Description
public
XMLString()

Default constructor.

public
XMLString(char[]
The character array.
ch
,
int
The offset into the character array.
offset
,
int
The length of characters from the offset.
length
)

Constructs an XMLString structure preset with the specified values.

public
XMLString(XMLString
The XMLString to copy.
string
)

Constructs an XMLString structure with copies of the values in the given structure.

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Resets all of the values to their defaults.

public boolean
equals(char[]
The character array.
ch
,
int
The offset into the character array.
offset
,
int
The length of characters from the offset.
length
)

Returns true if the contents of this XMLString structure and the specified array are equal.

public boolean
equals(String
The string to compare.
s
)

Returns true if the contents of this XMLString structure and the specified string are equal.

public void
setValues(char[]
The character array.
ch
,
int
The offset into the character array.
offset
,
int
The length of characters from the offset.
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()

Overrides java.lang.Object.toString.

Returns a string representation of this object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

chback to summary
public char[] ch

The character array.

lengthback to summary
public int length

The length of characters from the offset.

offsetback to summary
public int offset

The offset into the character array.

Constructor Detail

XMLStringback to summary
public XMLString()

Default constructor.

XMLStringback to summary
public XMLString(char[] ch, int offset, int length)

Constructs an XMLString structure preset with the specified values.

Parameters
ch:char[]

The character array.

offset:int

The offset into the character array.

length:int

The length of characters from the offset.

XMLStringback to summary
public XMLString(XMLString string)

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:XMLString

The XMLString to copy.

Method Detail

clearback to summary
public void clear()

Resets all of the values to their defaults.

equalsback to summary
public boolean equals(char[] ch, int offset, int length)

Returns true if the contents of this XMLString structure and the specified array are equal.

Parameters
ch:char[]

The character array.

offset:int

The offset into the character array.

length:int

The length of characters from the offset.

equalsback to summary
public boolean equals(String s)

Returns true if the contents of this XMLString structure and the specified string are equal.

Parameters
s:String

The string to compare.

setValuesback to summary
public void setValues(char[] ch, int offset, int length)

Initializes the contents of the XMLString structure with the specified values.

Parameters
ch:char[]

The character array.

offset:int

The offset into the character array.

length:int

The length of characters from the offset.

setValuesback to summary
public void setValues(XMLString s)

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.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a string representation of this object.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object.