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. 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. 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. More...
 
void refresh ()
 A method to force the. More...
 

Detailed Description

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

.

Definition at line 27 of file Iterator.java.

Member Function Documentation

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

Return the current element.

content.

Returns
The at current position.

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

int org.openoffice.xmerge.merger.Iterator.elementCount ( )
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

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
obj2The second .
Returns
true
if equal,
false
otherwise.

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

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

Object org.openoffice.xmerge.merger.Iterator.next ( )
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.ObjectArrayIterator, and org.openoffice.xmerge.merger.diff.NodeIterator.

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

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

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