CloneSet41


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

/**
 * An extensible list iterator implementation.
 */
protected class EListIterator<E1> extends EIterator<E1> implements ListIterator<E1> {
  /**
   * Creates an instance.
   */
  public EListIterator() {
    super();
  }

  /**
   * Creates an instance advanced to the index.
   * @param index the starting index.
   */
  public EListIterator(int index) {
    cursor = index;
  }

  /**
   * Returns whether there are more objects for {@link #previous}.
   * Returns whether there are more objects.
   */
  public boolean hasPrevious() {
    return cursor != 0;
  }

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

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

  /**
   * Returns the index of the object that would be returned by calling {@link #next() next}.
   * @return the index of the object that would be returned by calling <code>next</code>.
   */
  public int nextIndex() {
    return cursor;
  }

  /**
   * Returns the index of the object that would be returned by calling {@link #previous previous}.
   * @return the index of the object that would be returned by calling <code>previous</code>.
   */
  public int previousIndex() {
    return cursor - 1;
  }

  /**
   * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}.
   * This implementation delegates to {@link BasicEList#set set}.
   * @param object the object to set.
   * @exception IllegalStateException
   * if <code>next</code> or <code>previous</code> have not yet been called,
   * or {@link #remove(Object) remove} or {@link #add add} have already been called 
   * after the last call to <code>next</code> or <code>previous</code>.
   */
  @SuppressWarnings("unchecked") public void set(E1 object) {
    doSet((E) object);
  }

  /**
   * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}.
   * This implementation delegates to {@link BasicEList#set set}.
   * @param object the object to set.
   * @exception IllegalStateException
   * if <code>next</code> or <code>previous</code> have not yet been called,
   * or {@link #remove(Object) remove} or {@link #add add} have already been called 
   * after the last call to <code>next</code> or <code>previous</code>.
   */
  protected void doSet(E object) {
    if (lastCursor == -1) {
      throw new IllegalStateException();
    }
    checkModCount();
    try {
      BasicEList.this.set(lastCursor, object);
    }
    catch (IndexOutOfBoundsException
           exception) {
      throw new ConcurrentModificationException();
    }
  }

  /**
   * Adds the object at the {@link #next() next} index and advances the iterator past it.
   * This implementation delegates to {@link #doAdd(Object) doAdd(E)}.
   * @param object the object to add.
   */
  @SuppressWarnings("unchecked") public void add(E1 object) {
    doAdd((E) object);
  }

  /**
   * Adds the object at the {@link #next() next} index and advances the iterator past it.
   * This implementation delegates to {@link BasicEList#add(int, Object) add(int, E)}.
   * @param object the object to add.
   */
  protected void doAdd(E object) {
    checkModCount();
    try {
      BasicEList.this.add(cursor++ , object);
      expectedModCount = modCount;
      lastCursor = -1;
    }
    catch (IndexOutOfBoundsException
           exception) {
      throw new ConcurrentModificationException();
    }
  }
}

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


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

/**
 * An extensible list iterator implementation.
 */
protected class EListIterator<E1> extends EIterator<E1> implements ListIterator<E1> {
  /**
   * Creates an instance.
   */
  public EListIterator() {
    super();
  }

  /**
   * Creates an instance advanced to the index.
   * @param index the starting index.
   */
  public EListIterator(int index) {
    cursor = index;
  }

  /**
   * Returns whether there are more objects for {@link #previous}.
   * Returns whether there are more objects.
   */
  public boolean hasPrevious() {
    return cursor != 0;
  }

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

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

  /**
   * Returns the index of the object that would be returned by calling {@link #next() next}.
   * @return the index of the object that would be returned by calling <code>next</code>.
   */
  public int nextIndex() {
    return cursor;
  }

  /**
   * Returns the index of the object that would be returned by calling {@link #previous previous}.
   * @return the index of the object that would be returned by calling <code>previous</code>.
   */
  public int previousIndex() {
    return cursor - 1;
  }

  /**
   * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}.
   * This implementation delegates to {@link #doSet doSet}.
   * @param object the object to set.
   * @exception IllegalStateException
   * if <code>next</code> or <code>previous</code> have not yet been called,
   * or {@link #remove() remove} or {@link #add add} have already been called 
   * after the last call to <code>next</code> or <code>previous</code>.
   */
  @SuppressWarnings("unchecked") public void set(E1 object) {
    doSet((E) object);
  }

  /**
   * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}.
   * This implementation delegates to {@link DelegatingEList#set set}.
   * @param object the object to set.
   * @exception IllegalStateException
   * if <code>next</code> or <code>previous</code> have not yet been called,
   * or {@link #remove() remove} or {@link #add add} have already been called 
   * after the last call to <code>next</code> or <code>previous</code>.
   */
  protected void doSet(E object) {
    if (lastCursor == -1) {
      throw new IllegalStateException();
    }
    checkModCount();
    try {
      DelegatingEList.this.set(lastCursor, object);
    }
    catch (IndexOutOfBoundsException
           exception) {
      throw new ConcurrentModificationException();
    }
  }

  /**
   * Adds the object at the {@link #next() next} index and advances the iterator past it.
   * This implementation delegates to {@link #doAdd doAdd}.
   * @param object the object to add.
   */
  @SuppressWarnings("unchecked") public void add(E1 object) {
    doAdd((E) object);
  }

  /**
   * Adds the object at the {@link #next() next} index and advances the iterator past it.
   * This implementation delegates to {@link DelegatingEList#add(int, Object) add(int, Object)}.
   * @param object the object to add.
   */
  protected void doAdd(E object) {
    checkModCount();
    try {
      DelegatingEList.this.add(cursor++ , object);
      expectedModCount = modCount;
      lastCursor = -1;
    }
    catch (IndexOutOfBoundsException
           exception) {
      throw new ConcurrentModificationException();
    }
  }
}

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


Clone AbstractionParameter Count: 1Parameter Bindings

/**
   * An extensible list iterator implementation.
   */
protected class EListIterator<E1> extends EIterator<E1> implements ListIterator<E1> {
  /**
       * Creates an instance.
       */
  public EListIterator() {
    super();
  }

  /**
       * Creates an instance advanced to the index.
       * @param index the starting index.
       */
  public EListIterator(int index) {
    cursor = index;
  }

  /**
       * Returns whether there are more objects for {@link #previous}.
       * Returns whether there are more objects.
       */
  public boolean hasPrevious() {
    return cursor != 0;
  }

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

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

  /**
       * Returns the index of the object that would be returned by calling {@link #next() next}.
       * @return the index of the object that would be returned by calling <code>next</code>.
       */
  public int nextIndex() {
    return cursor;
  }

  /**
       * Returns the index of the object that would be returned by calling {@link #previous previous}.
       * @return the index of the object that would be returned by calling <code>previous</code>.
       */
  public int previousIndex() {
    return cursor - 1;
  }

  /**
       * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}.
       * This implementation delegates to {@link #doSet doSet}.
       * @param object the object to set.
       * @exception IllegalStateException
       * if <code>next</code> or <code>previous</code> have not yet been called,
       * or {@link #remove() remove} or {@link #add add} have already been called 
       * after the last call to <code>next</code> or <code>previous</code>.
       */
  /**
       * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}.
       * This implementation delegates to {@link BasicEList#set set}.
       * @param object the object to set.
       * @exception IllegalStateException
       * if <code>next</code> or <code>previous</code> have not yet been called,
       * or {@link #remove(Object) remove} or {@link #add add} have already been called 
       * after the last call to <code>next</code> or <code>previous</code>.
       */
  @SuppressWarnings("unchecked") public void set(E1 object) {
    doSet((E) object);
  }

  /**
       * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}.
       * This implementation delegates to {@link DelegatingEList#set set}.
       * @param object the object to set.
       * @exception IllegalStateException
       * if <code>next</code> or <code>previous</code> have not yet been called,
       * or {@link #remove() remove} or {@link #add add} have already been called 
       * after the last call to <code>next</code> or <code>previous</code>.
       */
  /**
       * Sets the object at the index of the last call to {@link #next() next} or {@link #previous previous}.
       * This implementation delegates to {@link BasicEList#set set}.
       * @param object the object to set.
       * @exception IllegalStateException
       * if <code>next</code> or <code>previous</code> have not yet been called,
       * or {@link #remove(Object) remove} or {@link #add add} have already been called 
       * after the last call to <code>next</code> or <code>previous</code>.
       */
  protected void doSet(E object) {
    if (lastCursor == -1) {
      throw new IllegalStateException();
    }
    checkModCount();
    try {
       [[#variable14690460]].this.set(lastCursor, object);
    }
    catch (IndexOutOfBoundsException
           exception) {
      throw new ConcurrentModificationException();
    }
  }

  /**
       * Adds the object at the {@link #next() next} index and advances the iterator past it.
       * This implementation delegates to {@link #doAdd doAdd}.
       * @param object the object to add.
       */
  /**
       * Adds the object at the {@link #next() next} index and advances the iterator past it.
       * This implementation delegates to {@link #doAdd(Object) doAdd(E)}.
       * @param object the object to add.
       */
  @SuppressWarnings("unchecked") public void add(E1 object) {
    doAdd((E) object);
  }

  /**
       * Adds the object at the {@link #next() next} index and advances the iterator past it.
       * This implementation delegates to {@link DelegatingEList#add(int, Object) add(int, Object)}.
       * @param object the object to add.
       */
  /**
       * Adds the object at the {@link #next() next} index and advances the iterator past it.
       * This implementation delegates to {@link BasicEList#add(int, Object) add(int, E)}.
       * @param object the object to add.
       */
  protected void doAdd(E object) {
    checkModCount();
    try {
       [[#variable14690460]].this.add(cursor++ , object);
      expectedModCount = modCount;
      lastCursor = -1;
    }
    catch (IndexOutOfBoundsException
           exception) {
      throw new ConcurrentModificationException();
    }
  }
}

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

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