KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > object > change > ObjectChangeIterator


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.object.change;
5
6 import java.util.Collection JavaDoc;
7 import java.util.Iterator JavaDoc;
8
9 /**
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 JavaDoc {
14   private final Iterator JavaDoc iter;
15
16   public ObjectChangeIterator(Collection JavaDoc objects) {
17     this.iter = objects.iterator();
18   }
19
20   public void remove() {
21     throw new UnsupportedOperationException JavaDoc("remove() not suppored");
22   }
23
24   public boolean hasNext() {
25     return this.iter.hasNext();
26   }
27
28   public Object JavaDoc next() {
29     return this.iter.next();
30   }
31 }
Popular Tags