FileDocCategorySizeDatePackage
UMLElementEnumeration.javaAPI DocExample1508Tue Dec 08 01:21:00 GMT 1998oisoft.togetherx.scriptapi.UML.enums

UMLElementEnumeration.java

/*----------------------------------------------------------------------------
Copyright (C) 1998 Object International Software GmbH
----------------------------------------------------------------------------*/
package oisoft.togetherx.scriptapi.UML.enums;

import java.util.Enumeration;

import oisoft.togetherx.scriptapi.UML.UMLElement;
import oisoft.togetherx.scriptapi.UML.UMLVisitor;

//------------------------------------------------------------------------------
/**
* Implemented typified enumeration for UMLElement
* @version  2.1.01  Thu Apr 02 19:15:21 1998
* @author   Andrei Ivanov
*/
public class UMLElementEnumeration implements Enumeration
{
  public UMLElementEnumeration(Enumeration e)
  {
    imp = e;
  }

  public UMLElement  getNextUMLElement()
  {
    if (imp != null)
      return (UMLElement) imp.nextElement();
    else
      return null;
  }

  public Object nextElement()
  {
    if (imp != null)
      return imp.nextElement();
    else
      return null;
  }

  public boolean hasMoreElements()
  {
    if (imp != null)
      return imp.hasMoreElements();
    else
      return false;
  }

  public void accept_to_all(UMLVisitor v)
  {
    if (imp != null) {
      while (imp.hasMoreElements()) {
        UMLElement element = (UMLElement) imp.nextElement();
        element.accept(v);
      }
    }
  }

  protected Enumeration imp;
}
//------------------------------------------------------------------------------