Class ForestChange.Add
Object
ForestChange
Add
- Enclosing class:
- 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.)
-
Nested Class Summary
Nested classes/interfaces inherited from class ForestChange
ForestChange.Add, ForestChange.Move, ForestChange.Remove, ForestChange.Reorder, ForestChange.Visitor -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(ForestChange.Visitor visitor) Apply the change to the visitorvoidapply(ArrayForest forest) Given mutable forest, apply the change to it.booleanReturns the added forest.longgetAfter()Returns the immediately preceding sibling of the first root of the added forest.longgetUnder()Returns the parent of the (roots of the) added forest, 0 if top level.inthashCode()toString()Methods inherited from class ForestChange
add, move, remove, reorder
-
Constructor Details
-
Add
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
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
Description copied from class:ForestChangeGiven mutable forest, apply the change to it.- Specified by:
applyin classForestChange- Parameters:
forest- forest to change
-
accept
Description copied from class:ForestChangeApply the change to the visitor- Specified by:
acceptin classForestChange- Parameters:
visitor- receiver of the call based on the type of this change
-
equals
-
hashCode
public int hashCode() -
toString
-