Module MaterialFX

Class ListChangeProcessor

java.lang.Object
io.github.palexdev.materialfx.utils.ListChangeProcessor

public class ListChangeProcessor extends Object
Helper class to process changes in ObservableLists.

It's capable of computing additions and removals.

  • Constructor Details

    • ListChangeProcessor

      public ListChangeProcessor(Set<Integer> indexes)
  • Method Details

    • computeAddition

      public void computeAddition(int addedSize, int offset)
      Computes additions given the number of items added and the index at which the addition occurred. All items after the given offset must be shifted of addedSize.
      Parameters:
      addedSize - the number of items added
      offset - the index at which the addition occurred
    • computeRemoval

      public void computeRemoval(Set<Integer> removed, int offset)
      Computes removals given the Set of removed indexes and the index at which the removal occurred. All items after the offset must be shifted, to correctly compute this shift, findShift(Set, int) is used.
      Parameters:
      removed - the Set of removed indexes
      offset - the index at which the removal occurred
    • getIndexes

      public Set<Integer> getIndexes()
      Returns:
      the updated indexes