1 /*******************************************************************************
2 * Copyright (c) 2000, 2003 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Common Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/cpl-v10.html
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package net.sourceforge.phpdt.internal.core.jdom;
13 import java.util.Enumeration;
15 import net.sourceforge.phpdt.core.jdom.IDOMNode;
18 * SiblingEnumeration provides an enumeration on a linked list of sibling DOM
21 * @see java.util.Enumeration
24 /* package */class SiblingEnumeration implements Enumeration {
27 * The current location in the linked list of DOM nodes.
29 protected IDOMNode fCurrentElement;
32 * Creates an enumeration of silbings starting at the given node. If the
33 * given node is <code>null</code> the enumeration is empty.
35 SiblingEnumeration(IDOMNode child) {
36 fCurrentElement = child;
40 * @see java.util.Enumeration#hasMoreElements()
42 public boolean hasMoreElements() {
43 return fCurrentElement != null;
47 * @see java.util.Enumeration#nextElement()
49 public Object nextElement() {
50 IDOMNode curr = fCurrentElement;
52 fCurrentElement = fCurrentElement.getNextNode();