01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdi.internal.event;
11:
12: import java.util.ListIterator;
13:
14: import com.sun.jdi.event.Event;
15: import com.sun.jdi.event.EventIterator;
16:
17: /**
18: * this class implements the corresponding interfaces
19: * declared by the JDI specification. See the com.sun.jdi package
20: * for more information.
21: *
22: */
23: public class EventIteratorImpl implements EventIterator {
24: /** List iterator implementation of iterator. */
25: private ListIterator fIterator;
26:
27: /**
28: * Creates new EventIteratorImpl.
29: */
30: public EventIteratorImpl(ListIterator iter) {
31: fIterator = iter;
32: }
33:
34: /**
35: * @return Returns next Event from EventSet.
36: */
37: public Event nextEvent() {
38: return (Event) fIterator.next();
39: }
40:
41: /**
42: * @see java.util.Iterator#hasNext()
43: */
44: public boolean hasNext() {
45: return fIterator.hasNext();
46: }
47:
48: /**
49: * @see java.util.Iterator#next()
50: */
51: public Object next() {
52: return fIterator.next();
53: }
54:
55: /**
56: * @see java.util.Iterator#remove()
57: * @exception UnsupportedOperationException always thrown since EventSets are unmodifiable.
58: */
59: public void remove() {
60: throw new UnsupportedOperationException(
61: EventMessages.EventIteratorImpl_EventSets_are_unmodifiable_1);
62: }
63: }
|