@ Nullable private AvlNode < E > firstNode ( ) { AvlNode < E > root = rootReference . get ( ) ; if ( root == null ) { return null ; } AvlNode < E > node ; if ( range . hasLowerBound ( ) ) { E endpoint = range . getLowerEndpoint ( ) ; node = rootReference . get ( ) . ceiling ( comparator ( ) , endpoint ) ; if ( node == null ) { return null ; } if ( range . getLowerBoundType ( ) == BoundType . OPEN && comparator ( ) . compare ( endpoint , node . getElement ( ) ) == 0 ) { node = node . succ ; } } else { node = header . succ ; } return ( node == header || ! range . contains ( node . getElement ( ) ) ) ? null : node ; }
Returns the first node in the tree that is in range .