Java Swing - O Reilly See also properties from (Domain and web hosting)
Friday, October 26th, 2007Java Swing - O Reilly See also properties from the AbstractDocument.AbstractElement class (Table 20.10) 20.1.13.2 Constructor public BranchElement(Element parent, AttributeSet a) Creates a new element with the specified parent and attributes. The element initially has no children. 20.1.13.3 Methods public Enumeration children() This method (from the TreeNode interface) returns an Enumeration of the element’s children. public int getElementIndex(int offset) Maps an absolute character offset to the child Element containing the given offset. It performs a binary search of the Element’s children, looking for a child that contains the given document offset. It returns the index of the closest Element it can find. If this branch does not contain the given offset, the index of either the first or last child is returned, depending on which side of this Element the given offset is located. If this element has no children, this method returns 0 (the same value returned if the input offset is found in the element’s first child). public Element positionToElement(int pos) Uses getElementIndex() to return the Element object at the given Document offset. If getElementIndex() returns the index of an Element that does not actually contain the given offset (which is possible, since it just returns the closest Element), null is returned. public void replace(int offset, int length, Element[] elems) Removes the requested number (length) of child Elements, starting at the specified offset, and replaces them with the input array of Elements. Note that the offset and lengthparameters specify the first child to remove and the number of children to remove. That is, they refer to the Element’s children, not Document characters. Note that this method performs as a delete operation if elems is empty, or to an insert operation if the length is zero. Also note that removed Elements may contain other Elements, which will also be removed. public String toString() Returns a String representation of the Element, formed by concatenating Branch Element, the Element’s name, and the Element’s start and end offsets. - 636
Visit our web design programs services for an affordable and reliable webhost to suit all your needs.