LibreOffice Module xmerge (master) 1
Public Member Functions | List of all members
org.openoffice.xmerge.merger.Iterator Interface Reference

This is an interface used by the DiffAlgorithm and MergeAlgorithm to access a Document. More...

Inheritance diagram for org.openoffice.xmerge.merger.Iterator:
[legend]

Public Member Functions

Object next ()
 Move to next element in the sequence. More...
 
Object start ()
 Move to the beginning of the sequence. More...
 
Object currentElement ()
 Return the current element Object content. More...
 
int elementCount ()
 Return the total element count in the sequence. More...
 
boolean equivalent (Object obj1, Object obj2)
 A method to allow the difference algorithm to test whether the obj1 and obj2 in the Iterator are considered equal. More...
 
void refresh ()
 A method to force the Iterator to traverse the tree again to refresh the content. More...
 

Detailed Description

This is an interface used by the DiffAlgorithm and MergeAlgorithm to access a Document.

Definition at line 27 of file Iterator.java.

Member Function Documentation

◆ currentElement()

Object org.openoffice.xmerge.merger.Iterator.currentElement ( )

Return the current element Object content.

Returns
The Object at current position.

Implemented in org.openoffice.xmerge.merger.diff.NodeIterator, and org.openoffice.xmerge.merger.diff.ObjectArrayIterator.

References Object.

◆ elementCount()

int org.openoffice.xmerge.merger.Iterator.elementCount ( )

◆ equivalent()

boolean org.openoffice.xmerge.merger.Iterator.equivalent ( Object  obj1,
Object  obj2 
)

A method to allow the difference algorithm to test whether the obj1 and obj2 in the Iterator are considered equal.

As not every Object in the Iterator can implement its own equal method, with this equivalent method, we can allow flexibility for the Iterator to choose a custom way to compare two objects. Two objects can even be compared based on the position in the Iterator rather than by the content via this option.

Parameters
obj1The first Object
obj2The second Object.
Returns
true if equal, false otherwise.

Implemented in org.openoffice.xmerge.merger.diff.NodeIterator, and org.openoffice.xmerge.merger.diff.ObjectArrayIterator.

Referenced by org.openoffice.xmerge.merger.diff.IteratorRowCompare.computeDiffs(), org.openoffice.xmerge.merger.diff.IteratorLCSAlgorithm.createDiffTable(), and org.openoffice.xmerge.merger.merge.PositionBaseRowMerge.mergeCellSequences().

◆ next()

Object org.openoffice.xmerge.merger.Iterator.next ( )

◆ refresh()

void org.openoffice.xmerge.merger.Iterator.refresh ( )

A method to force the Iterator to traverse the tree again to refresh the content.

It is used mainly for Iterator objects which take a snapshot instead of dynamically traversing the tree. The current position will be set to the beginning.

Implemented in org.openoffice.xmerge.merger.diff.NodeIterator, and org.openoffice.xmerge.merger.diff.ObjectArrayIterator.

Referenced by org.openoffice.xmerge.merger.diff.IteratorRowCompare.computeDiffs().

◆ start()

Object org.openoffice.xmerge.merger.Iterator.start ( )

The documentation for this interface was generated from the following file: