19 package org.openoffice.xmerge.merger.diff;
42 if (objArray != null) {
43 this.objArray =
new Object[objArray.length];
44 System.arraycopy(objArray, 0, this.objArray, 0, objArray.length);
47 this.objArray =
new Object[0];
52 if (currentPosition < objArray.length - 1) {
61 if (currentPosition > 0) {
75 if (objArray.length > 0) {
76 currentPosition = objArray.length - 1;
82 if (objArray.length > 0) {
107 if (currentPosition > 0) {
108 System.arraycopy(objArray, 0, objArray2, 0, currentPosition);
114 System.arraycopy(objArray, currentPosition, objArray2,
115 currentPosition + 1, objArray.length - currentPosition);
117 objArray = objArray2;
129 int newPosition = currentPosition + 1;
132 System.arraycopy(objArray, 0, objArray2, 0, newPosition);
134 objArray2[newPosition] = object;
137 if (currentPosition < objArray.length - 1) {
138 System.arraycopy(objArray, newPosition, objArray2,
139 newPosition + 1, objArray.length - newPosition);
142 objArray = objArray2;
148 public void remove() {
152 if (currentPosition > 0) {
153 System.arraycopy(objArray, 0, objArray2, 0, currentPosition);
157 if (currentPosition < objArray.length - 1) {
158 System.arraycopy(objArray, currentPosition + 1, objArray2,
159 currentPosition, objArray.length - currentPosition - 1);
162 objArray = objArray2;
164 if (currentPosition == objArray.length)
169 return objArray.length;
173 return obj1.equals(obj2);
ObjectArrayIterator(Object[] objArray)
Standard constructor.
Object currentElement()
Return the current element.
This is an implementation of the.
int elementCount()
Return the total element count in the sequence.
Object start()
Move to the beginning of the sequence.
void refresh()
A method to force the.
boolean equivalent(Object obj1, Object obj2)
A method to allow the difference algorithm to test whether the.
void replace(Object object)
Replace current.
void append(Object object)
Append.
void insert(Object object)
Insert.
Object next()
Move to next element in the sequence.
Provides interfaces for converting between two.
This is an interface used by the DiffAlgorithm and MergeAlgorithm to access a.