public MatcherPath commonPrefix ( MatcherPath that ) { checkArgNotNull ( that , "that" ) ; if ( element . level > that . element . level ) return parent . commonPrefix ( that ) ; if ( element . level < that . element . level ) return commonPrefix ( that . parent ) ; if ( this == that ) return this ; return ( parent != null && that . parent != null ) ? parent . commonPrefix ( that . parent ) : null ; }
Returns the common prefix of this MatcherPath and the given other one .