Class SetsDiff<T>
java.lang.Object
io.github.palexdev.virtualizedfx.collections.SetsDiff<T>
- Type Parameters:
T
- the type of objects contained in the Sets
Utils class to compute the difference between to Sets.
The resulting SetsDiff instance will contain two Sets for added and removed items.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> SetsDiff<T>
difference
(Set<T> first, Set<T> second) Computes the difference between the given sets.getAdded()
indexDifference
(Set<Integer> first, Set<Integer> second) Computes the difference between the given sets of indexes.
-
Method Details
-
difference
Computes the difference between the given sets.The resulting "added" Set will contain all the items of the second Set that are NOT contained in the first.
The resulting "removed" Set will contain all the items of the first Set that are NOT contained in the second.
- Returns:
- an instance of
SetsDiff
-
indexDifference
Computes the difference between the given sets of indexes.The resulting "added" Set will contain all the items of the second Set that are NOT contained in the first.
The resulting "removed" Set will contain all the items of the first Set that are NOT contained in the second and that are greater or equal to 0.
- Returns:
- an instance of
SetsDiff
-
getAdded
- Returns:
- the Set containing all the added items
-
getRemoved
- Returns:
- the Set containing all the removed items
-