FileDocCategorySizeDatePackage
TextImpl.javaAPI DocApache Xerces 3.0.14601Fri Sep 14 20:33:52 BST 2007org.apache.xerces.impl.xs.opti

TextImpl

public class TextImpl extends DefaultText
xerces.internal
author
Neil Graham, IBM
version
$Id: TextImpl.java 446728 2006-09-15 20:43:46Z mrglavas $

Fields Summary
String
fData
SchemaDOM
fSchemaDOM
int
fRow
int
fCol
Constructors Summary
public TextImpl(StringBuffer str, SchemaDOM sDOM, int row, int col)


             
        fData = str.toString();
        fSchemaDOM = sDOM;
        fRow = row;
        fCol = col;
        rawname = prefix = localpart = uri = null;
        nodeType = Node.TEXT_NODE;
    
Methods Summary
public java.lang.StringgetData()
The character data of the node that implements this interface. The DOM implementation may not put arbitrary limits on the amount of data that may be stored in a CharacterData node. However, implementation limits may mean that the entirety of a node's data may not fit into a single DOMString. In such cases, the user may call substringData to retrieve the data in appropriately sized pieces.

exception
DOMException NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
exception
DOMException DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a DOMString variable on the implementation platform.

        return fData;
    
public intgetLength()
The number of 16-bit units that are available through data and the substringData method below. This may have the value zero, i.e., CharacterData nodes may be empty.

        if(fData == null) return 0;
        return fData.length();
    
public org.w3c.dom.NodegetNextSibling()

        if (fCol == fSchemaDOM.relations[fRow].length-1) {
            return null;
        }
        return fSchemaDOM.relations[fRow][fCol+1];
    
public org.w3c.dom.NodegetParentNode()

        return fSchemaDOM.relations[fRow][0];
    
public org.w3c.dom.NodegetPreviousSibling()

        if (fCol == 1) {
            return null;
        }
        return fSchemaDOM.relations[fRow][fCol-1];
    
public java.lang.StringsubstringData(int offset, int count)
Extracts a range of data from the node.

param
offset Start offset of substring to extract.
param
count The number of 16-bit units to extract.
return
The specified substring. If the sum of offset and count exceeds the length, then all 16-bit units to the end of the data are returned.
exception
DOMException INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.
DOMSTRING_SIZE_ERR: Raised if the specified range of text does not fit into a DOMString.

        if(fData == null) return null;
        if(count < 0 || offset < 0 || offset > fData.length()) 
    	    throw new DOMException(DOMException.INDEX_SIZE_ERR, "parameter error");
        if(offset+count >= fData.length()) 
            return fData.substring(offset);
        return fData.substring(offset, offset+count);