OpenOffice.org
XMerge API

org.openoffice.xmerge.merger.diff
Class CellNodeIterator

java.lang.Object
  |
  +--org.openoffice.xmerge.merger.diff.NodeIterator
        |
        +--org.openoffice.xmerge.merger.diff.CellNodeIterator
All Implemented Interfaces:
Iterator

public final class CellNodeIterator
extends NodeIterator

This is an implementations of the Iterator interface. It will traverse the tree and find cell Node sequences.

Note: Once the XML Tree is parsed, then the Iterator will be a snap shot of that tree. That means even the tree is modified later, than the cached paragraph Node list will not be updated accordingly. For this reason and for performance reasons this Iterator does not support any operation methods such as insert, remove or replace. The main purpose of this Iterator is to be used with difference, not with merge.


Constructor Summary
CellNodeIterator(ConverterCapabilities cc, org.w3c.dom.Node node)
          The standard constructor.
 
Method Summary
protected  boolean childrenEqual(org.w3c.dom.Node node1, org.w3c.dom.Node node2)
          Compare the children of two Node objects.
protected  boolean nodeSupported(org.w3c.dom.Node node)
          Overwrite the parent nodeSupported method.
 
Methods inherited from class org.openoffice.xmerge.merger.diff.NodeIterator
attributesEqual, compareNode, currentElement, elementCount, end, equivalent, next, previous, refresh, start
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellNodeIterator

public CellNodeIterator(ConverterCapabilities cc,
                        org.w3c.dom.Node node)
The standard constructor.
Parameters:
cc - The ConverterCapabilities.
node - The initial root Node.
Method Detail

childrenEqual

protected boolean childrenEqual(org.w3c.dom.Node node1,
                                org.w3c.dom.Node node2)
Description copied from class: NodeIterator
Compare the children of two Node objects. This method can be intentionally overridden by any class that extend from NodeIterator so that it can have its own children comparison if necessary.
Overrides:
childrenEqual in class NodeIterator
Following copied from class: org.openoffice.xmerge.merger.diff.NodeIterator
Parameters:
node1 - The first Node to compare.
node2 - The second Node to compare.
Returns:
true if children are equal, false otherwise.

nodeSupported

protected boolean nodeSupported(org.w3c.dom.Node node)
Overwrite the parent nodeSupported method. Only cell Node objects are supported.
Overrides:
nodeSupported in class NodeIterator
Parameters:
node - The Node to check.
Returns:
true if the Node is supported, false otherwise.

OpenOffice.org
XMerge API

Copyright © 2002 OpenOffice.org