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
19 * of sibling DOM nodes.
21 * @see java.util.Enumeration
24 /* package */ class SiblingEnumeration implements Enumeration {
27 * The current location in the linked list
30 protected IDOMNode fCurrentElement;
32 * Creates an enumeration of silbings starting at the given node.
33 * If the given node is <code>null</code> the enumeration is empty.
35 SiblingEnumeration(IDOMNode child) {
36 fCurrentElement= child;
39 * @see java.util.Enumeration#hasMoreElements()
41 public boolean hasMoreElements() {
42 return fCurrentElement != null;
45 * @see java.util.Enumeration#nextElement()
47 public Object nextElement() {
48 IDOMNode curr= fCurrentElement;
50 fCurrentElement= fCurrentElement.getNextNode();