1 /* Copyright (C) 1999 Red Hat, Inc.
3 This file is part of libgcj.
5 This software is copyrighted work licensed under the terms of the
6 Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
11 import java.util.Enumeration;
12 import java.util.NoSuchElementException;
14 public class EnumerationChain implements Enumeration
16 private Enumeration first_;
17 private Enumeration second_;
19 public EnumerationChain (Enumeration first, Enumeration second)
23 throw new NullPointerException();
29 public synchronized boolean hasMoreElements()
34 return first_.hasMoreElements();
37 public synchronized Object nextElement() throws NoSuchElementException
39 while (first_ != null)
41 if (! first_.hasMoreElements())
47 return first_.nextElement();
50 throw new NoSuchElementException();