286N/A * reserved comment block 286N/A * DO NOT REMOVE OR ALTER! 286N/A * Copyright 1999-2002,2004,2005 The Apache Software Foundation. 286N/A * Licensed under the Apache License, Version 2.0 (the "License"); 286N/A * you may not use this file except in compliance with the License. 286N/A * You may obtain a copy of the License at 286N/A * Unless required by applicable law or agreed to in writing, software 286N/A * distributed under the License is distributed on an "AS IS" BASIS, 286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 286N/A * See the License for the specific language governing permissions and 286N/A * limitations under the License. 286N/A * The Document interface represents the entire HTML or XML document. 286N/A * Conceptually, it is the root of the document tree, and provides the 286N/A * primary access to the document's data. 286N/A * Since elements, text nodes, comments, processing instructions, 286N/A * etc. cannot exist outside the context of a Document, the Document 286N/A * interface also contains the factory methods needed to create these 286N/A * objects. The Node objects created have a ownerDocument attribute 286N/A * which associates them with the Document within whose context they 286N/A * @since PR-DOM-Level-1-19980818. 286N/A /** Serialization version. */ 286N/A /** To include code for printing the ref count tables. */ 286N/A /** To include code for printing the internal tables. */ 286N/A /** To debug identifiers set to true and recompile. */ 286N/A /** Initial chunk size. */ 286N/A // lazy-eval information 286N/A // To maximize memory consumption the actual semantic of these fields vary 286N/A // depending on the node type. 286N/A /** Node first children. */ 286N/A /** Node prev siblings. */ 286N/A /** Node namespace URI. */ 286N/A /** Identifier count. */ 286N/A /** Identifier name indexes. */ 286N/A /** Identifier element indexes. */ 286N/A /** DOM2: For namespace support in the deferred case. 286N/A // Implementation Note: The deferred element and attribute must know how to 286N/A // interpret the int representing the qname. 286N/A * NON-DOM: Actually creating a Document is outside the DOM's spec, 286N/A * since it has to operate in terms of a particular implementation. 286N/A * NON-DOM: Actually creating a Document is outside the DOM's spec, 286N/A * since it has to operate in terms of a particular implementation. 286N/A /** Experimental constructor. */ 286N/A }
// <init>(boolean,boolean) 286N/A * Retrieve information describing the abilities of this particular 286N/A * DOM implementation. Intended to support applications that may be 286N/A * using DOMs retrieved from several different sources, potentially 286N/A * with different underlying representations. 286N/A // Currently implemented as a singleton, since it's hardcoded 286N/A /** Returns the cached parser.getNamespaces() value.*/ 286N/A // internal factory methods 286N/A /** Creates a document node in the table. */ 286N/A /** Creates a doctype. */ 286N/A // save name, public id, system id 286N/A }
// createDeferredDocumentType(String,String,String):int 286N/A // create extra data node to store internal subset 286N/A /** Creates a notation in the table. */ 286N/A // create extra data node 286N/A // save name, public id, system id, and notation name 286N/A // in extra data node set baseURI value 286N/A }
// createDeferredNotation(String,String,String):int 286N/A /** Creates an entity in the table. */ 286N/A // create extra data node 286N/A // save name, public id, system id, and notation name 286N/A // set other values in the extra chunk 286N/A }
// createDeferredEntity(String,String,String,String):int 286N/A // DOM Level 3: setting encoding and version 286N/A // DOM Level 3: sets element TypeInfo 286N/A * An attribute specifying the actual encoding of this document. This is 286N/A * <code>null</code> otherwise. 286N/A * <br> This attribute represents the property [character encoding scheme] 286N/A // get first extra data chunk 286N/A // get second extra data chunk 286N/A /** Creates an entity reference node in the table. */ 286N/A }
// createDeferredEntityReference(String):int 286N/A * Creates an element node with a URI in the table and type information. 286N/A }
// createDeferredElement(String,String,Object):int 286N/A * Creates an element node in the table. 286N/A * Creates an element node with a URI in the table. 286N/A }
// createDeferredElement(String,String):int 286N/A * This method is used by the DOMParser to create attributes. 286N/A * @param elementNodeIndex 286N/A // set attribute's parent to element 286N/A // get element's last attribute 286N/A // add link from new attribute to last attribute 286N/A // add link from element to new last attribute 286N/A // store type information 286N/A * Sets an attribute on an element node. 286N/A // set attribute's parent to element 286N/A // get element's last attribute 286N/A // add link from new attribute to last attribute 286N/A // add link from element to new last attribute 286N/A }
// setDeferredAttribute(int,String,String,String,boolean):int 286N/A /** Creates an attribute in the table. */ 286N/A /** Creates an attribute with a URI in the table. */ 286N/A }
// createDeferredAttribute(String,String,String,boolean):int 286N/A /** Creates an element definition in the table.*/ 286N/A }
// createDeferredElementDefinition(String):int 286N/A /** Creates a text node in the table. */ 286N/A // use extra to store ignorableWhitespace info 286N/A }
// createDeferredTextNode(String,boolean):int 286N/A /** Creates a CDATA section node in the table. */ 286N/A }
// createDeferredCDATASection(String):int 286N/A /** Creates a processing instruction node in the table. */ 286N/A }
// createDeferredProcessingInstruction(String,String):int 286N/A /** Creates a comment node in the table. */ 286N/A }
// createDeferredComment(String):int 286N/A /** Creates a clone of the specified node. */ 286N/A // clone immediate node 286N/A // clone and attach children 286N/A // return cloned node index 286N/A }
// cloneNode(int,boolean):int 286N/A /** Appends a child to the specified parent in the table. */ 286N/A // set previous sibling of new child 286N/A // update parent's last child 286N/A }
// appendChild(int,int) 286N/A /** Adds an attribute node to the specified element. */ 286N/A // see if this attribute is already here 286N/A // remove old attribute 286N/A // remove connections to siblings 286N/A }
// setAttributeNode(int,int):int 286N/A /** Adds an attribute node to the specified element. */ 286N/A /** Sets type of attribute */ 286N/A /** Inserts a child before the specified node in the table. */ 286N/A }
// insertBefore(int,int,int):int 286N/A /** Sets the last child of the parentIndex to childIndex. */ 286N/A }
// setAsLastChild(int,int) 286N/A * Returns the parent node of the given node. 286N/A * <em>Calling this method does not free the parent index.</em> 286N/A * Returns the parent node of the given node. 286N/A * @param free True to free parent node. 286N/A }
// getParentNode(int):int 286N/A /** Returns the last child of the given node. */ 286N/A * Returns the last child of the given node. 286N/A * @param free True to free child index. 286N/A }
// getLastChild(int,boolean):int 286N/A * Returns the prev sibling of the given node. 286N/A * This is post-normalization of Text Nodes. 286N/A * Returns the prev sibling of the given node. 286N/A * @param free True to free sibling index. 286N/A }
// getPrevSibling(int,boolean):int 286N/A * Returns the <i>real</i> prev sibling of the given node, 286N/A * directly from the data structures. Used by TextImpl#getNodeValue() 286N/A * Returns the <i>real</i> prev sibling of the given node. 286N/A * @param free True to free sibling index. 286N/A }
// getReadPrevSibling(int,boolean):int 286N/A * Returns the index of the element definition in the table 286N/A * with the specified name index, or -1 if no such definition 286N/A // find element definition 286N/A }
// lookupElementDefinition(String):int 286N/A /** Instantiates the requested node object. */ 286N/A // is there anything to do? 286N/A // Standard DOM node types 286N/A // NOTE: Document fragments can never be "fast". 286N/A // The parser will never ask to create a document 286N/A // fragment during the parse. Document fragments 286N/A // are used by the application *after* the parse. 286N/A // case Node.DOCUMENT_FRAGMENT_NODE: { break; } 286N/A // this node is never "fast" 286N/A // save the doctype node 286N/A // check to see if this element needs to be 286N/A // registered for its ID attributes 286N/A // continue if there are more IDs for 286N/A // non-standard DOM node types 286N/A }
// createNodeObject(int):Node 286N/A /** Returns the name of the given node. */ 286N/A }
// getNodeNameString(int):String 286N/A * Returns the name of the given node. 286N/A * @param free True to free the string index. 286N/A }
// getNodeName(int,boolean):String 286N/A /** Returns the real value of the given node. */ 286N/A }
// getNodeValueString(int):String 286N/A * Returns the real value of the given node. 286N/A * @param free True to free the string index. 286N/A // append data that is stored in fNodeValue 286N/A // REVISIT: for text nodes it works differently than for CDATA 286N/A // go in reverse order: find last child, then 286N/A // its previous sibling, etc 286N/A // add to the buffer in the correct order. 286N/A // find if any other data stored in children 286N/A // append data that is stored in fNodeValue 286N/A // go in reverse order: find last child, then 286N/A // its previous sibling, etc 286N/A // add to the buffer in the correct order. 286N/A }
// getNodeValueString(int,boolean):String 286N/A * Returns the value of the given node. 286N/A * Clears the type info that is stored in the fNodeValue array 286N/A * Returns the value of the given node. 286N/A * @param free True to free the value index. 286N/A }
// getNodeValue(int,boolean):String 286N/A * Returns the extra info of the given node. 286N/A * Used by AttrImpl to store specified value (1 == true). 286N/A * Returns the extra info of the given node. 286N/A * @param free True to free the value index. 286N/A }
// getNodeExtra(int,boolean):int 286N/A /** Returns the type of the given node. */ 286N/A * Returns the type of the given node. 286N/A * @param free True to free type index. 286N/A }
// getNodeType(int):int 286N/A /** Returns the attribute value of the given name. */ 286N/A /** Returns the URI of the given node. */ 286N/A * Returns the URI of the given node. 286N/A * @param free True to free URI index. 286N/A }
// getNodeURI(int,int):String 286N/A // identifier maintenance 286N/A /** Registers an identifier name with a specified element node. */ 286N/A }
// putIdentifier(String,int) 286N/A /** Prints out the tables. */ 286N/A // This assumes that the document is small 286N/A // DeferredNode methods 286N/A /** Returns the node index. */ 286N/A /** Synchronizes the node's data. */ 286N/A // no need to sync in the future 286N/A // fluff up enough nodes to fill identifiers hash 286N/A // REVISIT: There has to be a more efficient way of 286N/A // doing this. But keep in mind that the 286N/A // tree can have been altered and re-ordered 286N/A // before all of the element nodes with ID 286N/A // attributes have been registered. For now 286N/A // this is reasonable and safe. -Ac 286N/A // ignore if it's already been registered 286N/A // find path from this element to the root 286N/A // Traverse path (backwards), fluffing the elements 286N/A // along the way. When this loop finishes, "place" 286N/A // will contain the reference to the element node 286N/A // we're interested in. -Ac 286N/A // register the element 286N/A // see if there are more IDs on this element 286N/A * Synchronizes the node's children with the internal structure. 286N/A * Fluffing the children at once solves a lot of work to keep 286N/A * the two structures in sync. The problem gets worse when 286N/A * editing the tree -- this makes it a lot easier. 286N/A * when we have elements with IDs this method is being recursively 286N/A * called from synchronizeData, in which case we've already gone 286N/A * through the following and we can now simply stop here. 286N/A // we don't want to generate any event for this so turn them off 286N/A // no need to sync in the future 286N/A // create children and link them as siblings 286N/A // save doctype and document type 286N/A // set mutation events flag back to its original value 286N/A }
// synchronizeChildren() 286N/A * Synchronizes the node's children with the internal structure. 286N/A * Fluffing the children at once solves a lot of work to keep 286N/A * the two structures in sync. The problem gets worse when 286N/A * editing the tree -- this makes it a lot easier. 286N/A * This is not directly used in this class but this method is 286N/A * here so that it can be shared by all deferred subclasses of AttrImpl. 286N/A // we don't want to generate any event for this so turn them off 286N/A // no need to sync in the future 286N/A // create children and link them as siblings or simply store the value 286N/A // as a String if all we have is one piece of text 286N/A // set mutation events flag back to its original value 286N/A }
// synchronizeChildren(AttrImpl,int):void 286N/A * Synchronizes the node's children with the internal structure. 286N/A * Fluffing the children at once solves a lot of work to keep 286N/A * the two structures in sync. The problem gets worse when 286N/A * editing the tree -- this makes it a lot easier. 286N/A * This is not directly used in this class but this method is 286N/A * here so that it can be shared by all deferred subclasses of ParentNode. 286N/A // we don't want to generate any event for this so turn them off 286N/A // no need to sync in the future 286N/A // create children and link them as siblings 286N/A // set mutation events flag back to its original value 286N/A }
// synchronizeChildren(ParentNode,int):void 286N/A /** Ensures that the internal tables are large enough. */ 286N/A // Done - there's sufficient capacity 286N/A }
// ensureCapacity(int,int) 286N/A /** Creates a node of the specified type. */ 286N/A // ensure tables are large enough 286N/A // return node index number 286N/A }
// createNode(short):int 286N/A * Performs a binary search for a target value in an array of 286N/A * values. The array of values must be in ascending sorted order 286N/A * before calling this method and all array values must be 286N/A * @param values The array of values to search. 286N/A * @param start The starting offset of the search. 286N/A * @param end The ending offset of the search. 286N/A * @param target The target value. 286N/A * @return This function will return the <i>first</i> occurrence 286N/A * of the target value, or -1 if the target value cannot 286N/A // look for target value 286N/A // is this the one we're looking for? 286N/A // is this point higher or lower? 286N/A }
// binarySearch(int[],int,int,int):int 286N/A /** Creates the specified chunk in the given array of chunks. */ 286N/A * Sets the specified value in the given of data at the chunk and index. 286N/A * @return Returns the old value. 286N/A // Re-create chunk if it was deleted. 286N/A // Re-create chunk if it was deleted. 286N/A * Returns the specified value in the given data at the chunk and index. 286N/A * Clears the specified value in the given data at the chunk and index. 286N/A * Note that this method will clear the given chunk if the reference 286N/A * @return Returns the old value. 286N/A * This version of putIdentifier is needed to avoid fluffing 286N/A * all of the paths to ID attributes when a node object is 286N/A * created that contains an ID attribute. 286N/A // save ID and its associated element 286N/A }
// putIdentifier0(String,Element) 286N/A /** Prints the ID array. */ 286N/A }
// print(int[],int,int,int,int) 286N/A * A simple integer vector. 286N/A /** Returns the length of this vector. */ 286N/A /** Returns the element at the specified index. */ 286N/A /** Appends an element to the end of the vector. */ 286N/A /** Clears the vector. */ 286N/A /** Makes sure that there is enough storage. */ 286N/A }
// ensureCapacity(int) 286N/A}
// class DeferredDocumentImpl