Package org.eclipse.handly.ui.workingset
Class AbstractWorkingSetUpdater.WorkingSetDelta
java.lang.Object
org.eclipse.handly.ui.workingset.AbstractWorkingSetUpdater.WorkingSetDelta
- Enclosing class:
- AbstractWorkingSetUpdater
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 TypeMethodDescriptionint
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.
-
Method Details
-
indexOf
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 replaceelement
- the element to be stored at the given index (notnull
)- 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
-