CloneSet83


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
113210.994class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
11141277
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/common/util/BasicEList.java
21131027
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/common/util/DelegatingEList.java
Next
Last
Clone Instance
1
Line Count
114
Source Line
1277
Source File
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/common/util/BasicEList.java

/**
 * An extensible iterator implementation.
 */
protected class EIterator<E1> implements Iterator<E1> {
  /**
   * The current position of the iterator.
   */
  protected int cursor = 0;

  /**
   * The previous position of the iterator.
   */
  protected int lastCursor = -1;

  /**
   * The modification count of the containing list.
   */
  protected int expectedModCount = modCount;

  /**
   * Returns whether there are more objects.
   * @return whether there are more objects.
   */
  public boolean hasNext() {
    return cursor != size();
  }

  /**
   * Returns the next object and advances the iterator.
   * This implementation delegates to {@link #doNext doNext}.
   * @return the next object.
   * @exception NoSuchElementException if the iterator is done.
   */
  @SuppressWarnings("unchecked") public E1 next() {
    return (E1) doNext();
  }

  /**
   * Returns the next object and advances the iterator.
   * This implementation delegates to {@link BasicEList#get get}.
   * @return the next object.
   * @exception NoSuchElementException if the iterator is done.
   */
  protected E doNext() {
    try {
      E next = BasicEList.this.get(cursor);
      checkModCount();
      lastCursor = cursor++;
      return next;
    }
    catch (IndexOutOfBoundsException
           exception) {
      checkModCount();
      throw new NoSuchElementException();
    }
  }

  /**
   * Removes the last object returned by {@link #next()} from the list,
   * it's an optional operation.
   * This implementation can also function in a list iterator 
   * to act upon on the object returned by calling <code>previous</code>.
   * @exception IllegalStateException
   * if <code>next</code> has not yet been called,
   * or <code>remove</code> has already been called after the last call to <code>next</code>.
   */
  public void remove() {
    if (lastCursor == -1) {
      throw new IllegalStateException();
    }
    checkModCount();
    try {
      BasicEList.this.remove(lastCursor);
      expectedModCount = modCount;
      if (lastCursor < cursor) {
        --cursor;
      }
      lastCursor = -1;
    }
    catch (IndexOutOfBoundsException
           exception) {
      throw new ConcurrentModificationException();
    }
  }

  /**
   * Checks that the modification count is as expected.
   * @exception ConcurrentModificationException if the modification count is not as expected.
   */
  protected void checkModCount() {
    if (modCount != expectedModCount) {
      throw new ConcurrentModificationException();
    }
  }
}

/**
 * Returns a read-only iterator that does not {@link #resolve resolve} objects.
 * This implementation allocates a {@link NonResolvingEIterator}.
 * @return a read-only iterator that does not resolve objects.
 */
protected Iterator<E> basicIterator() {
  return new NonResolvingEIterator<E>();
}


First
Previous
Clone Instance
2
Line Count
113
Source Line
1027
Source File
E:/TSE/Projects-CloneDR/emf-2.4.1/src/org/eclipse/emf/common/util/DelegatingEList.java

/**
 * An extensible iterator implementation.
 */
protected class EIterator<E1> implements Iterator<E1> {
  /**
   * The current position of the iterator.
   */
  protected int cursor = 0;

  /**
   * The previous position of the iterator.
   */
  protected int lastCursor = -1;

  /**
   * The modification count of the containing list.
   */
  protected int expectedModCount = modCount;

  /**
   * Returns whether there are more objects.
   * @return whether there are more objects.
   */
  public boolean hasNext() {
    return cursor != size();
  }

  /**
   * Returns the next object and advances the iterator.
   * This implementation delegates to {@link #doNext doNext}.
   * @return the next object.
   * @exception NoSuchElementException if the iterator is done.
   */
  @SuppressWarnings("unchecked") public E1 next() {
    return (E1) doNext();
  }

  /**
   * Returns the next object and advances the iterator.
   * This implementation delegates to {@link DelegatingEList#get get}.
   * @return the next object.
   * @exception NoSuchElementException if the iterator is done.
   */
  protected E doNext() {
    try {
      E next = DelegatingEList.this.get(cursor);
      checkModCount();
      lastCursor = cursor++;
      return next;
    }
    catch (IndexOutOfBoundsException
           exception) {
      checkModCount();
      throw new NoSuchElementException();
    }
  }

  /**
   * Removes the last object returned by {@link #next()} from the list,
   * it's an optional operation.
   * This implementation can also function in a list iterator 
   * to act upon on the object returned by calling <code>previous</code>.
   * @exception IllegalStateException
   * if <code>next</code> has not yet been called,
   * or <code>remove</code> has already been called after the last call to <code>next</code>.
   */
  public void remove() {
    if (lastCursor == -1) {
      throw new IllegalStateException();
    }
    checkModCount();
    try {
      DelegatingEList.this.remove(lastCursor);
      expectedModCount = modCount;
      if (lastCursor < cursor) {
        --cursor;
      }
      lastCursor = -1;
    }
    catch (IndexOutOfBoundsException
           exception) {
      throw new ConcurrentModificationException();
    }
  }

  /**
   * Checks that the modification count is as expected.
   * @exception ConcurrentModificationException if the modification count is not as expected.
   */
  protected void checkModCount() {
    if (modCount != expectedModCount) {
      throw new ConcurrentModificationException();
    }
  }
}

/**
 * Returns a read-only iterator that does not {@link #resolve resolve} objects.
 * This implementation allocates a {@link NonResolvingEIterator}.
 * @return a read-only iterator that does not resolve objects.
 */
protected Iterator<E> basicIterator() {
  return new NonResolvingEIterator<E>();
}


Clone AbstractionParameter Count: 1Parameter Bindings

/**
   * An extensible iterator implementation.
   */
protected class EIterator<E1> implements Iterator<E1> {
  /**
       * The current position of the iterator.
       */
  protected int cursor = 0;

  /**
       * The previous position of the iterator.
       */
  protected int lastCursor = -1;

  /**
       * The modification count of the containing list.
       */
  protected int expectedModCount = modCount;

  /**
       * Returns whether there are more objects.
       * @return whether there are more objects.
       */
  public boolean hasNext() {
    return cursor != size();
  }

  /**
       * Returns the next object and advances the iterator.
       * This implementation delegates to {@link #doNext doNext}.
       * @return the next object.
       * @exception NoSuchElementException if the iterator is done.
       */
  @SuppressWarnings("unchecked") public E1 next() {
    return (E1) doNext();
  }

  /**
       * Returns the next object and advances the iterator.
       * This implementation delegates to {@link DelegatingEList#get get}.
       * @return the next object.
       * @exception NoSuchElementException if the iterator is done.
       */
  /**
       * Returns the next object and advances the iterator.
       * This implementation delegates to {@link BasicEList#get get}.
       * @return the next object.
       * @exception NoSuchElementException if the iterator is done.
       */
  protected E doNext() {
    try {
      E next = [[#variable19024480]].this.get(cursor);
      checkModCount();
      lastCursor = cursor++;
      return next;
    }
    catch (IndexOutOfBoundsException
           exception) {
      checkModCount();
      throw new NoSuchElementException();
    }
  }

  /**
       * Removes the last object returned by {@link #next()} from the list,
       * it's an optional operation.
       * This implementation can also function in a list iterator 
       * to act upon on the object returned by calling <code>previous</code>.
       * @exception IllegalStateException
       * if <code>next</code> has not yet been called,
       * or <code>remove</code> has already been called after the last call to <code>next</code>.
       */
  public void remove() {
    if (lastCursor == -1) {
      throw new IllegalStateException();
    }
    checkModCount();
    try {
       [[#variable19024480]].this.remove(lastCursor);
      expectedModCount = modCount;
      if (lastCursor < cursor) {
        --cursor;
      }
      lastCursor = -1;
    }
    catch (IndexOutOfBoundsException
           exception) {
      throw new ConcurrentModificationException();
    }
  }

  /**
       * Checks that the modification count is as expected.
       * @exception ConcurrentModificationException if the modification count is not as expected.
       */
  protected void checkModCount() {
    if (modCount != expectedModCount) {
      throw new ConcurrentModificationException();
    }
  }
}

/**
   * Returns a read-only iterator that does not {@link #resolve resolve} objects.
   * This implementation allocates a {@link NonResolvingEIterator}.
   * @return a read-only iterator that does not resolve objects.
   */
protected Iterator<E> basicIterator() {
  return new NonResolvingEIterator<E>();
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#19024480]]
BasicEList 
12[[#19024480]]
DelegatingEList