Node<K,V> findNear(K kkey,int rel){
  Comparable<? super K> key=comparable(kkey);
  for (; ; ) {
    Node<K,V> b=findPredecessor(key);
    Node<K,V> n=b.next;
    for (; ; ) {
      if (n == null)       return ((rel & LT) == 0 || b.isBaseHeader()) ? null : b;
      Node<K,V> f=n.next;
      if (n != b.next)       break;
      Object v=n.value;
      if (v == null) {
        n.helpDelete(b,f);
        break;
      }
      if (v == n || b.value == null)       break;
      int c=key.compareTo(n.key);
      if ((c == 0 && (rel & EQ) != 0) || (c < 0 && (rel & LT) == 0))       return n;
      if (c <= 0 && (rel & LT) != 0)       return b.isBaseHeader() ? null : b;
      b=n;
      n=f;
    }
  }
}

Node < K , V > findNear ( K kkey , int rel ) { Comparable < ? super K > key = comparable ( kkey ) ; for ( ; ; ) { Node < K , V > b = findPredecessor ( key ) ; Node < K , V > n = b . next ; for ( ; ; ) { if ( n == null ) return ( ( rel & LT ) == 0 || b . isBaseHeader ( ) ) ? null : b ; Node < K , V > f = n . next ; if ( n != b . next ) break ; Object v = n . value ; if ( v == null ) { n . helpDelete ( b , f ) ; break ; } if ( v == n || b . value == null ) break ; int c = key . compareTo ( n . key ) ; if ( ( c == 0 && ( rel & EQ ) != 0 ) || ( c < 0 && ( rel & LT ) == 0 ) ) return n ; if ( c <= 0 && ( rel & LT ) != 0 ) return b . isBaseHeader ( ) ? null : b ; b = n ; n = f ; } } }
utility for ceiling , floor , lower , higher methods .
