public boolean isPrefixMatch ( VersionID vid ) { if ( _isCompound ) { if ( ! _rest . isPrefixMatch ( vid ) ) { return false ; } } // Make sure that vid is at least as long as the prefix String [ ] t2 = normalize ( vid . _tuple , _tuple . length ) ; for ( int i = 0 ; i < _tuple . length ; i ++ ) { Object e1 = _tuple [ i ] ; Object e2 = t2 [ i ] ; if ( e1 . equals ( e2 ) ) { // So far so good } else { // Not a prefix return false ; } } return true ; }
Checks if this is a prefix of vid