/** * Compare the attributes. Return true if they are alike. * Ignore the order of the elements. */ private boolean compareAttributeValuesWithoutOrder(Object collection1, Object collection2, AbstractSession session) { ContainerPolicy cp = this.getContainerPolicy(); Vector vector2 = cp.vectorFor(collection2, session);// "clone" it so we can clear out the slots for (Object iter1 = cp.iteratorFor(collection1); cp.hasNext(iter1);) { Object element1 = cp.next(iter1, session); boolean found = false; for (int i = 0; i < vector2.size(); i++) { if (this.compareElements(element1, vector2.elementAt(i), session)) { found = true; vector2.setElementAt(XXX, i);// clear out the matching element break;// matching element found - skip the rest of them } } if (!found) { return false; } } // look for elements that were not in collection1 for (Enumeration stream = vector2.elements(); stream.hasMoreElements();) { if (stream.nextElement() != XXX) { return false; } } return true; }
/** * Compare the attributes. Return true if they are alike. * Ignore the order of the elements. */ private boolean compareAttributeValuesWithoutOrder(Object collection1, Object collection2, AbstractSession session) { ContainerPolicy cp = this.getContainerPolicy(); List vector2 = cp.vectorFor(collection2, session);// "clone" it so we can clear out the slots for (Object iter1 = cp.iteratorFor(collection1); cp.hasNext(iter1);) { Object element1 = cp.next(iter1, session); boolean found = false; for (int i = 0; i < vector2.size(); i++) { if (this.compareElements(element1, vector2.get(i), session)) { found = true; vector2.set(i, XXX);// clear out the matching element break;// matching element found - skip the rest of them } } if (!found) { return false; } } // look for elements that were not in collection1 for (Object value : vector2) { if (value != XXX) { return false; } } return true; }
/** * Compare the attributes. Return true if they are alike. * Ignore the order of the elements. */ private boolean compareAttributeValuesWithoutOrder(Object collection1, Object collection2, AbstractSession session) { ContainerPolicy cp = this.getContainerPolicy(); List vector2 = cp.vectorFor(collection2, session);// "clone" it so we can clear out the slots for (Object iter1 = cp.iteratorFor(collection1); cp.hasNext(iter1);) { Object element1 = cp.next(iter1, session); boolean found = false; for (int i = 0; i < vector2.size(); i++) { if (this.compareElements(element1, vector2.get(i), session)) { found = true; vector2.set(i, XXX);// clear out the matching element break;// matching element found - skip the rest of them } } if (!found) { return false; } } // look for elements that were not in collection1 for (Object value : vector2) { if (value != XXX) { return false; } } return true; }
/** * Compare the attributes. Return true if they are alike. * The order of the elements is significant. */ private boolean compareAttributeValuesWithOrder(Object collection1, Object collection2, AbstractSession session) { ContainerPolicy cp = this.getContainerPolicy(); Object iter1 = cp.iteratorFor(collection1); Object iter2 = cp.iteratorFor(collection2); while (cp.hasNext(iter1)) { if (!this.compareElements(cp.next(iter1, session), cp.next(iter2, session), session)) { return false; } } return true; }
/** * Compare the attributes. Return true if they are alike. * The order of the elements is significant. */ private boolean compareAttributeValuesWithOrder(Object collection1, Object collection2, AbstractSession session) { ContainerPolicy cp = this.getContainerPolicy(); Object iter1 = cp.iteratorFor(collection1); Object iter2 = cp.iteratorFor(collection2); while (cp.hasNext(iter1)) { if (!this.compareElements(cp.next(iter1, session), cp.next(iter2, session), session)) { return false; } } return true; }
/** * Compare the attributes. Return true if they are alike. * The order of the elements is significant. */ private boolean compareAttributeValuesWithOrder(Object collection1, Object collection2, AbstractSession session) { ContainerPolicy cp = this.getContainerPolicy(); Object iter1 = cp.iteratorFor(collection1); Object iter2 = cp.iteratorFor(collection2); while (cp.hasNext(iter1)) { if (!this.compareElements(cp.next(iter1, session), cp.next(iter2, session), session)) { return false; } } return true; }
for (Object iter = cp.iteratorFor(targetCollection); cp.hasNext(iter);) { targetElement = cp.next(iter, session); if (this.compareElements(targetElement, removeElement, session)) { break;// matching element found - skip the rest of them
for (Object iter = cp.iteratorFor(targetCollection); cp.hasNext(iter);) { targetElement = cp.next(iter, session); if (this.compareElements(targetElement, removeElement, session)) { break;// matching element found - skip the rest of them
for (Object iter = cp.iteratorFor(targetCollection); cp.hasNext(iter);) { targetElement = cp.next(iter, session); if (this.compareElements(targetElement, removeElement, session)) { break;// matching element found - skip the rest of them