Package org.eclipse.handly.ui.workingset

# Class AbstractWorkingSetUpdater.WorkingSetDelta

java.lang.Object
org.eclipse.handly.ui.workingset.AbstractWorkingSetUpdater.WorkingSetDelta

Enclosing class:
  AbstractWorkingSetUpdater

protected static class AbstractWorkingSetUpdater.WorkingSetDelta extends Object
Utility class used to help process element change events. The content of a working set can be updated by creating, modifying, and applying a working set delta. When a working set delta is created, it is initialized with a copy of the content of its underlying working set.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `indexOf(Object element)`
  Returns the index of the first occurrence of the given element in this delta, or -1 if this delta does not contain the element.
  `void`
  `remove(int index)`
  Removes the element at the given index in this delta.
  `void`
  `set(int index, org.eclipse.core.runtime.IAdaptable element)`
  Replaces the element at the given index in this delta with the given element.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### indexOf

    public int indexOf(Object element)
    Returns the index of the first occurrence of the given element in this delta, or -1 if this delta does not contain the element.
    Parameters:
      `element` - the element to search for
    Returns:
      the index of the first occurrence of the given element in this delta, or -1 if this delta does not contain the element

  - ### set

    public void set(int index, org.eclipse.core.runtime.IAdaptable element)
    Replaces the element at the given index in this delta with the given element.
    Parameters:
      `index` - the index of the element to replace
      `element` - the element to be stored at the given index (not `null`)
    Throws:
      `IndexOutOfBoundsException` - if the index is out of range

  - ### remove

    public void remove(int index)
    Removes the element at the given index in this delta. Shifts any subsequent elements to the left (subtracts one from their indices).
    Parameters:
      `index` - the index of the element to be removed
    Throws:
      `IndexOutOfBoundsException` - if the index is out of range