01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.object.change;
05:
06: import java.util.Collection;
07: import java.util.Iterator;
08:
09: /**
10: * The iterator passed to customer change callback methods. The most important feature of this class is that is does not
11: * allow remove() to be called
12: */
13: public class ObjectChangeIterator implements Iterator {
14: private final Iterator iter;
15:
16: public ObjectChangeIterator(Collection objects) {
17: this .iter = objects.iterator();
18: }
19:
20: public void remove() {
21: throw new UnsupportedOperationException("remove() not suppored");
22: }
23:
24: public boolean hasNext() {
25: return this .iter.hasNext();
26: }
27:
28: public Object next() {
29: return this.iter.next();
30: }
31: }
|