final Node firstDataNode ( ) { restartFromHead : for ( ; ; ) { for ( Node p = head ; p != null ; ) { Object item = p . item ; if ( p . isData ) { if ( item != null && item != FORGOTTEN ) return p ; } else if ( item == null ) break ; if ( UNLINKED == ( p = p . next ) ) continue restartFromHead ; } return null ; } }
Returns the first unmatched data node or null if none . Callers must recheck if the returned node s item field is null or self - linked before using .