Class ForestChange.Reorder

Enclosing class:
ForestChange

public static class ForestChange.Reorder extends ForestChange
Represents a complete reorder of the direct children of a given row. The list of children must contain exactly the same rows, but in a different order.
  • Constructor Details

    • Reorder

      public Reorder(long under, @NotNull LongList children)
      Creates a "reorder" change.
  • Method Details

    • getUnder

      public long getUnder()
      Returns the parent of the reordered rows, 0 if top-level rows are reordered.
    • getChildren

      @NotNull public LongList getChildren()
      Returns the new order of the child elements.
    • apply

      public void apply(@NotNull ArrayForest forest)
      Description copied from class: ForestChange
      Given mutable forest, apply the change to it.
      Specified by:
      apply in class ForestChange
      Parameters:
      forest - forest to change
    • accept

      public void accept(ForestChange.Visitor visitor)
      Description copied from class: ForestChange
      Apply the change to the visitor
      Specified by:
      accept in class ForestChange
      Parameters:
      visitor - receiver of the call based on the type of this change
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object