package EDU.neu.ccs.demeter.tools.apstudio.graphedit;
import java.awt.*;
import java.io.*;
import java.util.*;
import EDU.neu.ccs.demeter.*;
import EDU.neu.ccs.demeter.common.tg.*;


import EDU.neu.ccs.demeter.*;
class InterfaceModifier_List implements java.util.Enumeration, Cloneable {
  protected Nonempty_InterfaceModifier_List first;
  public Nonempty_InterfaceModifier_List get_first() { return first; }
  public void set_first(Nonempty_InterfaceModifier_List new_first)
    { first = new_first; }
  InterfaceModifier_List() { super(); }
  public InterfaceModifier_List(Nonempty_InterfaceModifier_List first) {
    super();
    set_first(first);
  }
  public static InterfaceModifier_List parse(java.io.InputStream in) throws ParseException
    { return new Parser(in)._InterfaceModifier_List(); }
  public static InterfaceModifier_List parse(String s) {
    try { return parse(new java.io.ByteArrayInputStream(s.getBytes())); }
    catch (ParseException e) { throw new RuntimeException(e.toString()); }
  }
  void universal_trv0_bef(UniversalVisitor _v_) {
    _v_.before(this);
  }
  void universal_trv0_aft(UniversalVisitor _v_) {
    _v_.after(this);
  }
  void universal_trv0(UniversalVisitor _v_) {
    universal_trv0_bef(_v_);
    _v_.before_first(this, first);
    first.universal_trv0(_v_);
    _v_.after_first(this, first);
    universal_trv0_aft(_v_);
  }
  void saveGraph_UGraph_trv_bef(SaveGraphVisitor sgv) {  }
  void saveGraph_UGraph_trv_aft(SaveGraphVisitor sgv) {  }
  void saveGraph_UGraph_trv(SaveGraphVisitor sgv) {
    saveGraph_UGraph_trv_bef(sgv);
    first.saveGraph_UGraph_trv(sgv);
    saveGraph_UGraph_trv_aft(sgv);
  }
  void saveMarkedGraph_UGraph_trv_bef(SelectMarkedVisitor v) {  }
  void saveMarkedGraph_UGraph_trv_aft(SelectMarkedVisitor v) {  }
  void saveMarkedGraph_UGraph_trv(SelectMarkedVisitor v) {
    saveMarkedGraph_UGraph_trv_bef(v);
    first.saveMarkedGraph_UGraph_trv(v);
    saveMarkedGraph_UGraph_trv_aft(v);
  }
  void toallCdString_UVertex_trv_bef(cdStringVisitor __v0) {  }
  void toallCdString_UVertex_trv_aft(cdStringVisitor __v0) {  }
  void toallCdString_UVertex_trv(cdStringVisitor __v0) {
    toallCdString_UVertex_trv_bef(__v0);
    first.toallCdString_UVertex_trv(__v0);
    toallCdString_UVertex_trv_aft(__v0);
  }

  private Nonempty_InterfaceModifier_List tail;
  public void addElement(InterfaceModifier e) { 
    checktail(); 
    if (tail == null) {
      first = new Nonempty_InterfaceModifier_List(e,null); tail = first;
    } else {
	tail.set_next(new Nonempty_InterfaceModifier_List(e,null)); tail = tail.get_next();
    }
  }

  public void push(InterfaceModifier e) { first = new Nonempty_InterfaceModifier_List(e,first); }

  public java.util.Enumeration elements() { return new InterfaceModifier_List(first); } 

  public int size() {
    int i= 0;
    for (java.util.Enumeration e=elements(); e.hasMoreElements(); i++)
	e.nextElement();
    return i;
  }
  public boolean isEmpty() { return (first == null); }

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

  public Object nextElement() {
    InterfaceModifier car = first.get_it();
    first = first.get_next();
    return (Object) car;
  }

  private void checktail() {
    if (tail == null && first != null) {
	tail = first;
	while (tail.get_next() != null) tail = tail.get_next();
    }
  }
  public boolean contains(InterfaceModifier e) {
    java.util.Enumeration en = this.elements();
    while (en.hasMoreElements())
	if (e.equals((InterfaceModifier) en.nextElement())) return true;
    return false;
  }
}

