LibreOffice Module xmerge (master) 1
|
This is an implementation of the Iterator
interface.
More...
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 Object content. More... | |
void | replace (Object object) |
Replace current Object . More... | |
void | insert (Object object) |
Insert Object after current Object . More... | |
void | append (Object object) |
Append Object after current Object . More... | |
void | remove () |
Remove current Object . 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... | |
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... | |
Private Attributes | |
Object[] | objArray |
The Object array. More... | |
int | currentPosition |
This is an implementation of the Iterator
interface.
It is based upon a simple Object
array.
Note: this class is not thread safe for performance reasons.
Definition at line 30 of file ObjectArrayIterator.java.
|
inline |
Standard constructor.
objArray | The Object array. |
Definition at line 41 of file ObjectArrayIterator.java.
References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, org.openoffice.xmerge.merger.diff.ObjectArrayIterator.objArray, Object, and System.
|
inline |
Append Object
after current Object
.
object | Object to append. |
Definition at line 126 of file ObjectArrayIterator.java.
References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, org.openoffice.xmerge.merger.diff.ObjectArrayIterator.objArray, Object, and System.
|
inline |
Return the current element Object
content.
Object
at current position. Implements org.openoffice.xmerge.merger.Iterator.
Definition at line 81 of file ObjectArrayIterator.java.
References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, org.openoffice.xmerge.merger.diff.ObjectArrayIterator.objArray, and Object.
Referenced by org.openoffice.xmerge.merger.diff.ObjectArrayIterator.end(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.next(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.previous(), and org.openoffice.xmerge.merger.diff.ObjectArrayIterator.start().
|
inline |
Return the total element count in the sequence.
Implements org.openoffice.xmerge.merger.Iterator.
Definition at line 168 of file ObjectArrayIterator.java.
References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.objArray.
|
inline |
|
inline |
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.
obj1 | The first Object |
obj2 | The second Object . |
true
if equal, false
otherwise. Implements org.openoffice.xmerge.merger.Iterator.
Definition at line 172 of file ObjectArrayIterator.java.
|
inline |
Insert Object
after current Object
.
object | Object to insert. |
Definition at line 103 of file ObjectArrayIterator.java.
References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, org.openoffice.xmerge.merger.diff.ObjectArrayIterator.objArray, Object, and System.
|
inline |
Move to next element in the sequence.
Object
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(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, org.openoffice.xmerge.merger.diff.ObjectArrayIterator.objArray, and Object.
|
inline |
Definition at line 60 of file ObjectArrayIterator.java.
References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentElement(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, and Object.
|
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.
|
inline |
Remove current Object
.
Definition at line 148 of file ObjectArrayIterator.java.
References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, org.openoffice.xmerge.merger.diff.ObjectArrayIterator.objArray, Object, and System.
|
inline |
Replace current Object
.
object | Object to replace. |
Definition at line 94 of file ObjectArrayIterator.java.
References org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, and org.openoffice.xmerge.merger.diff.ObjectArrayIterator.objArray.
|
inline |
Move to the beginning of the sequence.
Object
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(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentPosition, and Object.
|
private |
Definition at line 34 of file ObjectArrayIterator.java.
Referenced by org.openoffice.xmerge.merger.diff.ObjectArrayIterator.append(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentElement(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.end(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.insert(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.next(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.ObjectArrayIterator(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.previous(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.remove(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.replace(), and org.openoffice.xmerge.merger.diff.ObjectArrayIterator.start().
|
private |
The Object
array.
Definition at line 33 of file ObjectArrayIterator.java.
Referenced by org.openoffice.xmerge.merger.diff.ObjectArrayIterator.append(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.currentElement(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.elementCount(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.end(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.insert(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.next(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.ObjectArrayIterator(), org.openoffice.xmerge.merger.diff.ObjectArrayIterator.remove(), and org.openoffice.xmerge.merger.diff.ObjectArrayIterator.replace().