compareTo

open operator override fun compareTo(other: Node): Int

Compares Node by depth and position at each depth.

Return

a negative value if depth is less than the other node depth or if depths are the same and position is less than the other nodes position. If the depth and position are the same (which should not happen) it will compare by ids. Otherwise it will return a positive value.