NiceListEnumeration.java

jmud-0.11/src/util/nice/NiceListEnumeration.java · 535 B

From the archive jmud-0_11.tgz

Download the archive   « Back to the archive contents

package util.nice;

import java.util.NoSuchElementException;

class NiceListEnumeration implements NiceEnumeration {

  private NiceListLink cursor = null;

  public NiceListEnumeration(NiceList aList) {
    cursor = aList.getHead();
  }

  public boolean hasMoreElements() {
    return cursor != null;
  }

  public Niceable nextElement() throws NoSuchElementException {
    if (!hasMoreElements())
      throw new NoSuchElementException();
    Niceable info = cursor.getInfo();
    cursor = cursor.getNext();
    return info;
  }
}

Site Stats

Snippets: 1791
Codebases: 571