APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xerces.internal.xni

public Class XMLString

extends Object
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xerces.internal.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

Field Summary

Modifier and TypeField and Description
public char[]
ch

The character array.

public static final int
DEFAULT_SIZE

Default buffer size (32).

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
append(char
the char
c
)

Appends a char to the buffer.

public void
append(String
the string
s
)

Appends a string to the buffer.

public void
append(char[]
the char array
ch
,
int
the offset
offset
,
int
the length
length
)

Appends a number of characters to the buffer.

public void
append(XMLString
another buffer
s
)

Appends another buffer to this buffer

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.

DEFAULT_SIZEback to summary
public static final int DEFAULT_SIZE

Default buffer size (32).

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

appendback to summary
public void append(char c)

Appends a char to the buffer.

Parameters
c:char

the char

appendback to summary
public void append(String s)

Appends a string to the buffer.

Parameters
s:String

the string

appendback to summary
public void append(char[] ch, int offset, int length)

Appends a number of characters to the buffer.

Parameters
ch:char[]

the char array

offset:int

the offset

length:int

the length

appendback to summary
public void append(XMLString s)

Appends another buffer to this buffer

Parameters
s:XMLString

another buffer

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.