Class ForestChange.Add

Enclosing class:
ForestChange

public static class ForestChange.Add extends ForestChange
Represents addition to the forest. An addition of a whole contiguous sub-forest may be expressed with this class. The added rows must not be already present in the forest. (Unlike Structure 2 API, this is not "merge" operation.)
  • Constructor Details

    • Add

      public Add(@NotNull Forest addedForest, long under, long after)
      Creates "add" change with a forest being added.
    • Add

      public Add(long row, long under, long after)
      Creates "add" change with one row being added.
  • Method Details

    • getAddedForest

      @NotNull public Forest getAddedForest()
      Returns the added forest.
    • getUnder

      public long getUnder()
      Returns the parent of the (roots of the) added forest, 0 if top level.
    • getAfter

      public long getAfter()
      Returns the immediately preceding sibling of the first root of the added forest.
    • 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