|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.openoffice.xmerge.merger.diff.ObjectArrayIterator
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.
Constructor Summary | |
ObjectArrayIterator(java.lang.Object[] objArray)
Standard constructor. |
Method Summary | |
void |
append(java.lang.Object object)
Append Object after current Object . |
java.lang.Object |
currentElement()
Return the current element Object content. |
int |
elementCount()
Return the total element count in the sequence. |
java.lang.Object |
end()
Move to the end of the sequence. |
boolean |
equivalent(java.lang.Object obj1,
java.lang.Object obj2)
A method to allow the difference algorithm to test whether the obj1 and obj2 in the
Iterator are considered equal. |
void |
insert(java.lang.Object object)
Insert Object after current Object . |
java.lang.Object |
next()
Move to next element in the sequence. |
java.lang.Object |
previous()
Move to previous element in the sequence. |
void |
refresh()
A method to force the Iterator to transverse the tree
again to refresh the content. |
void |
remove()
Remove current Object . |
void |
replace(java.lang.Object object)
Replace current Object . |
java.lang.Object |
start()
Move to the beginning of the sequence. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ObjectArrayIterator(java.lang.Object[] objArray)
objArray
- The Object
array.Method Detail |
public void append(java.lang.Object object)
Object
after current Object
.object
- Object
to append.public java.lang.Object currentElement()
Iterator
Object
content.currentElement
in interface Iterator
org.openoffice.xmerge.merger.Iterator
Object
at current position.public int elementCount()
Iterator
elementCount
in interface Iterator
org.openoffice.xmerge.merger.Iterator
public java.lang.Object end()
Iterator
end
in interface Iterator
org.openoffice.xmerge.merger.Iterator
Object
of the last element in the sequence.
If it is empty, then return null.public boolean equivalent(java.lang.Object obj1, java.lang.Object obj2)
Iterator
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.equivalent
in interface Iterator
org.openoffice.xmerge.merger.Iterator
obj1
- The first Object
.obj2
- The second Object
.public void insert(java.lang.Object object)
Object
after current Object
.object
- Object
to insert.public java.lang.Object next()
Iterator
next
in interface Iterator
org.openoffice.xmerge.merger.Iterator
Object
of the next element in the sequence.
If there is no next element, then return null.public java.lang.Object previous()
Iterator
previous
in interface Iterator
org.openoffice.xmerge.merger.Iterator
Object
of the previous element in the sequence.
If there is no previous element, then return null.public void refresh()
Iterator
A method to force the Iterator
to transverse the tree
again to refresh the content.
It is used mainly for Iterator
objects which take a snap
shot instead of dynamically transversing the tree. The current
position will be set to the beginning.
refresh
in interface Iterator
public void remove()
Object
.public void replace(java.lang.Object object)
Object
.object
- Object
to replace.public java.lang.Object start()
Iterator
start
in interface Iterator
org.openoffice.xmerge.merger.Iterator
Object
of the first element in the sequence.
If it is empty, then return null.
|
OpenOffice.org XMerge API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |