@@ -0,0 +1,2490 @@
+/*%0A * Copyright (c) 2014 Bernold Kraft, Sebastian Riemsch%C3%BCssel, Torsten Kr%C3%A4mer (Berlin, Germany).%0A * All rights reserved. This program and the accompanying materials%0A * are made available under the terms of the Eclipse Public License v1.0%0A * which accompanies this distribution, and is available at%0A * http://www.eclipse.org/legal/epl-v10.html%0A * %0A * Contributors:%0A * Initial commit by Riemi @ 27.08.2015.%0A */%0Apackage de.bitub.step.p21.util;%0A%0Aimport java.util.Iterator;%0Aimport java.util.List;%0A%0Aimport org.eclipse.emf.ecore.EAnnotation;%0Aimport org.eclipse.emf.ecore.EStructuralFeature;%0A%0A/**%0A * %3C!-- begin-user-doc --%3E%0A * Stateful parameter iterator using @P21 model annotations.%0A * %3C!-- end-user-doc --%3E%0A * %0A * @generated NOT%0A * @author Riemsch%C3%BCssel - 07.12.15%0A */%0Apublic class P21ParameterIterator%3CE extends EStructuralFeature%3E implements Iterator%3CE%3E%0A%7B%0A  private static final String SOURCE_URI = %22http://www.bitub.de/express/P21%22;%0A%0A  List%3CE%3E featuresList = null;%0A  int curIndex = -1;%0A%0A  /**%0A   * %3C!-- begin-user-doc --%3E%0A   * %3C!-- end-user-doc --%3E%0A   * %0A   * @generated NOT%0A   */%0A  public P21ParameterIterator(List%3CE%3E list)%0A  %7B%0A    this.featuresList = list;%0A  %7D%0A%0A  /**%0A   * %3C!-- begin-user-doc --%3E%0A   * %3C!-- end-user-doc --%3E%0A   * %0A   * @generated NOT%0A   * @see java.util.Iterator#hasNext()%0A   */%0A  @Override%0A  public boolean hasNext()%0A  %7B%0A    int pointer = curIndex + 1; // restore old index state%0A%0A    // go forward until new annotation found, else no NEXT%0A    //%0A    while (pointer %3C this.featuresList.size()) %7B%0A%0A      EStructuralFeature eStructuralFeature = this.featuresList.get(pointer);%0A      EAnnotation eAnnotation = eStructuralFeature.getEAnnotation(SOURCE_URI);%0A%0A      if (eAnnotation != null) %7B%0A        return true;%0A      %7D%0A      pointer++;%0A    %7D%0A%0A    return false;%0A  %7D%0A%0A  /**%0A   * %3C!-- begin-user-doc --%3E%0A   * %3C!-- end-user-doc --%3E%0A   * %0A   * @generated NOT%0A   * @see java.util.Iterator#next()%0A   */%0A  @Override%0A  public E next()%0A  %7B%0A    int pointer = curIndex + 1; // restore old index state%0A%0A    // go forward until new annotation found, else no NEXT%0A    //%0A    while (pointer %3C this.featuresList.size()) %7B%0A%0A      EStructuralFeature eStructuralFeature = this.featuresList.get(pointer);%0A      EAnnotation eAnnotation = eStructuralFeature.getEAnnotation(SOURCE_URI);%0A%0A      if (eAnnotation != null) %7B%0A%0A        curIndex = pointer;%0A        return featuresList.get(curIndex);%0A      %7D%0A      pointer++;%0A    %7D%0A%0A    return null;%0A  %7D%0A%0A  public int index()%0A  %7B%0A    return curIndex;%0A  %7D%0A%7D%0A

add parameter iterator which uses @P21 anntotations to map indices