APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xpath.internal.objects

public Class XStringForChars

extends XString
Class Inheritance
Imports
com.sun.org.apache.xalan.internal.res.XSLMessages, com.sun.org.apache.xml.internal.utils.FastStringBuffer, com.sun.org.apache.xpath.internal.res.XPATHErrorResources

This class will wrap a FastStringBuffer and allow for

Field Summary

Modifier and TypeField and Description
pack-priv int
m_length

The length of the string.

pack-priv int
m_start

The start position in the fsb.

protected String
pack-priv static final long
Inherited from com.sun.org.apache.xpath.internal.objects.XString:
EMPTYSTRING

Constructor Summary

AccessConstructor and Description
public
XStringForChars(char[]
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
XStringForChars(String
String object this will wrap.
val
)

Construct a XNodeSet object.

Method Summary

Modifier and TypeMethod and Description
public void

Returns:

The string this wraps or the empty string if null
appendToFsb
(FastStringBuffer fsb)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.appendToFsb.

Cast result object to a string.

public char

Returns:

the character at the specified index of this string. The first character is at index 0.
charAt
(int
the index of the character.
index
)

Overrides com.sun.org.apache.xpath.internal.objects.XString.charAt.

Implements com.sun.org.apache.xml.internal.utils.XMLString.charAt.

Returns the character at the specified index.

public void
dispatchAsComment(LexicalHandler
A non-null reference to a LexicalHandler.
lh
)

Overrides com.sun.org.apache.xpath.internal.objects.XString.dispatchAsComment.

Implements com.sun.org.apache.xml.internal.utils.XMLString.dispatchAsComment.

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.sun.org.apache.xpath.internal.objects.XString.dispatchCharactersEvents.

Implements com.sun.org.apache.xml.internal.utils.XMLString.dispatchCharactersEvents.

Directly call the characters method on the passed ContentHandler for the string-value.

public FastStringBuffer

Returns:

The string this wraps or the empty string if null
fsb
()

Cast result object to a string.

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.sun.org.apache.xpath.internal.objects.XString.getChars.

Implements com.sun.org.apache.xml.internal.utils.XMLString.getChars.

Copies characters from this string into the destination character array.

public boolean

Returns:

true if this XMLString can return a string without creating one.
hasString
()

Overrides com.sun.org.apache.xpath.internal.objects.XString.hasString.

Implements com.sun.org.apache.xml.internal.utils.XMLString.hasString.

Tell if this object contains a java String object.

public int

Returns:

the length of the sequence of characters represented by this object.
length
()

Overrides com.sun.org.apache.xpath.internal.objects.XString.length.

Implements com.sun.org.apache.xml.internal.utils.XMLString.length.

Returns the length of this string.

public Object

Returns:

The java String representation of this object.
object
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.object.

Since this object is incomplete without the length and the offset, we have to convert to a string when this function is called.

public String

Returns:

The string this wraps or the empty string if null
str
()

Overrides com.sun.org.apache.xpath.internal.objects.XString.str.

Cast result object to a string.

Inherited from com.sun.org.apache.xpath.internal.objects.XString:
boolcallVisitorscompareTocompareToIgnoreCaseconcatendsWithequalsequalsequalsequalsequalsIgnoreCasefixWhiteSpacegetTypegetTypeStringhashCodeindexOfindexOfindexOfindexOfindexOflastIndexOflastIndexOflastIndexOflastIndexOfnumrtfstartsWithstartsWithstartsWithstartsWithsubstringsubstringtoDoubletoLowerCasetoLowerCasetoUpperCasetoUpperCasetrimxstr

Field Detail

m_lengthback to summary
pack-priv int m_length

The length of the string.

m_startback to summary
pack-priv int m_start

The start position in the fsb.

m_strCacheback to summary
protected String m_strCache
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.sun.org.apache.xpath.internal.objects.XString.serialVersionUID.

Constructor Detail

XStringForCharsback to summary
public XStringForChars(char[] val, int start, int length)

Construct a XNodeSet object.

Parameters
val:char[]

FastStringBuffer object this will wrap, must be non-null.

start:int

The start position in the array.

length:int

The number of characters to read from the array.

XStringForCharsback to summary
private XStringForChars(String val)

Construct a XNodeSet object.

Parameters
val:String

String object this will wrap.

Method Detail

appendToFsbback to summary
public void appendToFsb(FastStringBuffer fsb)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.appendToFsb.

Cast result object to a string.

Returns:void

The string this wraps or the empty string if null

charAtback to summary
public char charAt(int index)

Overrides com.sun.org.apache.xpath.internal.objects.XString.charAt.

Implements com.sun.org.apache.xml.internal.utils.XMLString.charAt.

Returns the character at the specified index. An index ranges from 0 to length() - 1. The first character of the sequence is at index 0, the next at index 1, and so on, as for array indexing.

Parameters
index:int

the index of the character.

Returns:char

the character at the specified index of this string. The first character is at index 0.

Exceptions
IndexOutOfBoundsException:
if the index argument is negative or not less than the length of this string.
dispatchAsCommentback to summary
public void dispatchAsComment(LexicalHandler lh) throws SAXException

Overrides com.sun.org.apache.xpath.internal.objects.XString.dispatchAsComment.

Implements com.sun.org.apache.xml.internal.utils.XMLString.dispatchAsComment.

Directly call the comment method on the passed LexicalHandler for the string-value.

Parameters
lh:LexicalHandler

A non-null reference to a LexicalHandler.

dispatchCharactersEventsback to summary
public void dispatchCharactersEvents(ContentHandler ch) throws SAXException

Overrides com.sun.org.apache.xpath.internal.objects.XString.dispatchCharactersEvents.

Implements com.sun.org.apache.xml.internal.utils.XMLString.dispatchCharactersEvents.

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.

Parameters
ch:ContentHandler

A non-null reference to a ContentHandler.

fsbback to summary
public FastStringBuffer fsb()

Cast result object to a string.

Returns:FastStringBuffer

The string this wraps or the empty string if null

getCharsback to summary
public void getChars(int srcBegin, int srcEnd, char[] dst, int dstBegin)

Overrides com.sun.org.apache.xpath.internal.objects.XString.getChars.

Implements com.sun.org.apache.xml.internal.utils.XMLString.getChars.

Copies characters from this string into the destination character array.

Parameters
srcBegin:int

index of the first character in the string to copy.

srcEnd:int

index after the last character in the string to copy.

dst:char[]

the destination array.

dstBegin:int

the start offset in the destination array.

Exceptions
IndexOutOfBoundsException:
If any of the following is true:
  • srcBegin is negative.
  • srcBegin is greater than srcEnd
  • srcEnd is greater than the length of this string
  • dstBegin is negative
  • dstBegin+(srcEnd-srcBegin) is larger than dst.length
NullPointerException:
if dst is null
hasStringback to summary
public boolean hasString()

Overrides com.sun.org.apache.xpath.internal.objects.XString.hasString.

Implements com.sun.org.apache.xml.internal.utils.XMLString.hasString.

Tell if this object contains a java String object.

Returns:boolean

true if this XMLString can return a string without creating one.

lengthback to summary
public int length()

Overrides com.sun.org.apache.xpath.internal.objects.XString.length.

Implements com.sun.org.apache.xml.internal.utils.XMLString.length.

Returns the length of this string.

Returns:int

the length of the sequence of characters represented by this object.

objectback to summary
public Object object()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.object.

Since this object is incomplete without the length and the offset, we have to convert to a string when this function is called.

Returns:Object

The java String representation of this object.

strback to summary
public String str()

Overrides com.sun.org.apache.xpath.internal.objects.XString.str.

Cast result object to a string.

Returns:String

The string this wraps or the empty string if null