LibreOffice Module xmerge (master)  1
Public Member Functions | Private Attributes | List of all members
org.openoffice.xmerge.merger.diff.ObjectArrayIterator Class Reference

This is an implementation of the. More...

Inheritance diagram for org.openoffice.xmerge.merger.diff.ObjectArrayIterator:
[legend]
Collaboration diagram for org.openoffice.xmerge.merger.diff.ObjectArrayIterator:
[legend]

Public Member Functions

 ObjectArrayIterator (Object[] objArray)
 Standard constructor. More...
 
Object next ()
 Move to next element in the sequence. More...
 
Object previous ()
 
Object start ()
 Move to the beginning of the sequence. More...
 
Object end ()
 
Object currentElement ()
 Return the current element. More...
 
void replace (Object object)
 Replace current. More...
 
void insert (Object object)
 Insert. More...
 
void append (Object object)
 Append. More...
 
void remove ()
 Remove current. 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...
 

Private Attributes

Object[] objArray
 The. More...
 
int currentPosition
 

Detailed Description

This is an implementation of the.

Iterator

interface.

It is based upon a simple

array.

Note: this class is not thread safe for performance reasons.

Definition at line 30 of file ObjectArrayIterator.java.

Constructor & Destructor Documentation

org.openoffice.xmerge.merger.diff.ObjectArrayIterator.ObjectArrayIterator ( Object []  objArray)
inline

Standard constructor.

Parameters
objArrayThe array.

Definition at line 41 of file ObjectArrayIterator.java.

References Object, and System.

Member Function Documentation

void org.openoffice.xmerge.merger.diff.ObjectArrayIterator.append ( Object  object)
inline

Append.

after current

.

Parameters
object

Definition at line 126 of file ObjectArrayIterator.java.

References Object, and System.

Object org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentElement ( )
inline
int org.openoffice.xmerge.merger.diff.ObjectArrayIterator.elementCount ( )
inline

Return the total element count in the sequence.

Returns
The total element count.

Implements org.openoffice.xmerge.merger.Iterator.

Definition at line 168 of file ObjectArrayIterator.java.

Object org.openoffice.xmerge.merger.diff.ObjectArrayIterator.end ( )
inline
boolean org.openoffice.xmerge.merger.diff.ObjectArrayIterator.equivalent ( Object  obj1,
Object  obj2 
)
inline

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.

Implements org.openoffice.xmerge.merger.Iterator.

Definition at line 172 of file ObjectArrayIterator.java.

void org.openoffice.xmerge.merger.diff.ObjectArrayIterator.insert ( Object  object)
inline

Insert.

after current

.

Parameters
object

Definition at line 103 of file ObjectArrayIterator.java.

References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, Object, and System.

Object org.openoffice.xmerge.merger.diff.ObjectArrayIterator.next ( )
inline

Move to next element in the sequence.

Returns
The of the next element in the sequence. If there is no next element, then return
null
.

Implements org.openoffice.xmerge.merger.Iterator.

Definition at line 51 of file ObjectArrayIterator.java.

References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentElement(), and Object.

Object org.openoffice.xmerge.merger.diff.ObjectArrayIterator.previous ( )
inline
void org.openoffice.xmerge.merger.diff.ObjectArrayIterator.refresh ( )
inline

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.

Implements org.openoffice.xmerge.merger.Iterator.

Definition at line 176 of file ObjectArrayIterator.java.

void org.openoffice.xmerge.merger.diff.ObjectArrayIterator.remove ( )
inline

Remove current.

.

Definition at line 148 of file ObjectArrayIterator.java.

References Object, and System.

void org.openoffice.xmerge.merger.diff.ObjectArrayIterator.replace ( Object  object)
inline

Replace current.

.

Parameters
object

Definition at line 94 of file ObjectArrayIterator.java.

References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition.

Object org.openoffice.xmerge.merger.diff.ObjectArrayIterator.start ( )
inline

Move to the beginning of the sequence.

Returns
The of the first element in the sequence. If it is empty, then return
null
.

Implements org.openoffice.xmerge.merger.Iterator.

Definition at line 69 of file ObjectArrayIterator.java.

References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentElement(), and Object.

Member Data Documentation

int org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition
private
Object [] org.openoffice.xmerge.merger.diff.ObjectArrayIterator.objArray
private

The.

array.

Definition at line 33 of file ObjectArrayIterator.java.


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