KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdi > internal > event > EventIteratorImpl


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdi.internal.event;
12
13
14 import java.util.ListIterator JavaDoc;
15
16 import com.sun.jdi.event.Event;
17 import com.sun.jdi.event.EventIterator;
18
19 /**
20  * this class implements the corresponding interfaces
21  * declared by the JDI specification. See the com.sun.jdi package
22  * for more information.
23  *
24  */

25 public class EventIteratorImpl implements EventIterator {
26     /** List iterator implementation of iterator. */
27     private ListIterator JavaDoc fIterator;
28     
29     /**
30      * Creates new EventIteratorImpl.
31      */

32     public EventIteratorImpl(ListIterator JavaDoc iter) {
33         fIterator = iter;
34     }
35
36     /**
37      * @return Returns next Event from EventSet.
38      */

39     public Event nextEvent() {
40         return (Event)fIterator.next();
41     }
42
43     /**
44      * @see java.util.Iterator#hasNext()
45      */

46     public boolean hasNext() {
47         return fIterator.hasNext();
48     }
49    
50     /**
51      * @see java.util.Iterator#next()
52      */

53     public Object JavaDoc next() {
54         return fIterator.next();
55     }
56     
57     /**
58      * @see java.util.Iterator#remove()
59      * @exception UnsupportedOperationException always thrown since EventSets are unmodifiable.
60      */

61     public void remove() {
62         throw new UnsupportedOperationException JavaDoc(EventMessages.EventIteratorImpl_EventSets_are_unmodifiable_1);
63     }
64 }
65
Popular Tags