<s> package org . eclipse . jdt . internal . core . search . matching ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . core . search . * ; public class QualifiedTypeDeclarationPattern extends TypeDeclarationPattern { public char [ ] qualification ; PackageDeclarationPattern packagePattern ; public int packageIndex = - 1 ; public QualifiedTypeDeclarationPattern ( char [ ] qualification , char [ ] simpleName , char typeSuffix , int matchRule ) { this ( matchRule ) ; this . qualification = this . isCaseSensitive ? qualification : CharOperation . toLowerCase ( qualification ) ; this . simpleName = ( this . isCaseSensitive || this . isCamelCase ) ? simpleName : CharOperation . toLowerCase ( simpleName ) ; this . typeSuffix = typeSuffix ; this . mustResolve = this . qualification != null || typeSuffix != TYPE_SUFFIX ; } public QualifiedTypeDeclarationPattern ( char [ ] qualification , int qualificationMatchRule , char [ ] simpleName , char typeSuffix , int matchRule ) { this ( qualification , simpleName , typeSuffix , matchRule ) ; this . packagePattern = new PackageDeclarationPattern ( qualification , qualificationMatchRule ) ; } QualifiedTypeDeclarationPattern ( int matchRule ) { super ( matchRule ) ; } public void decodeIndexKey ( char [ ] key ) { int slash = CharOperation . indexOf ( SEPARATOR , key , 0 ) ; this . simpleName = CharOperation . subarray ( key , 0 , slash ) ; int start = ++ slash ; if ( key [ start ] == SEPARATOR ) { this . pkg = CharOperation . NO_CHAR ; } else { slash = CharOperation . indexOf ( SEPARATOR , key , start ) ; this . pkg = internedPackageNames . add ( CharOperation . subarray ( key , start , slash ) ) ; } this . qualification = this . pkg ; int last = key . length - 1 ; this . secondary = key [ last ] == 'S' ; if ( this . secondary ) { last -= 2 ; } this . modifiers = key [ last - 1 ] + ( key [ last ] << 16 ) ; decodeModifiers ( ) ; start = slash + 1 ; last -= 2 ; if ( start == last ) { this . enclosingTypeNames = CharOperation . NO_CHAR_CHAR ; } else { int length = this . qualification . length ; int size = last - start ; System . arraycopy ( this . qualification , 0 , this . qualification = new char [ length + 1 + size ] , 0 , length ) ; this . qualification [ length ] = '.' ; if ( last == ( start + 1 ) && key [ start ] == ZERO_CHAR ) { this . enclosingTypeNames = ONE_ZERO_CHAR ; this . qualification [ length + 1 ] = ZERO_CHAR ; } else { this . enclosingTypeNames = CharOperation . splitOn ( '.' , key , start , last ) ; System . arraycopy ( key , start , this . qualification , length + 1 , size ) ; } } } public SearchPattern getBlankPattern ( ) { return new QualifiedTypeDeclarationPattern ( R_EXACT_MATCH | R_CASE_SENSITIVE ) ; } public boolean matchesDecodedKey ( SearchPattern decodedPattern ) { QualifiedTypeDeclarationPattern pattern = ( QualifiedTypeDeclarationPattern ) decodedPattern ; if ( this . typeSuffix != pattern . typeSuffix && this . typeSuffix != TYPE_SUFFIX ) { if ( ! matchDifferentTypeSuffixes ( this . typeSuffix , pattern . typeSuffix ) ) { return false ; } } return matchesName ( this . simpleName , pattern . simpleName ) && ( this . qualification == null || this . packagePattern == null || this . packagePattern . matchesName ( this . qualification , pattern . qualification ) ) ; } protected StringBuffer print ( StringBuffer output ) { switch ( this . typeSuffix ) { case CLASS_SUFFIX : output . append ( "" ) ; break ; case CLASS_AND_INTERFACE_SUFFIX : output . append ( "" ) ; break ; case CLASS_AND_ENUM_SUFFIX : output . append ( "" ) ; break ; case INTERFACE_SUFFIX : output . append ( "" ) ; break ; case INTERFACE_AND_ANNOTATION_SUFFIX : output . append ( "" ) ; break ; case ENUM_SUFFIX : output . append ( "" ) ; break ; case ANNOTATION_TYPE_SUFFIX : output . append ( "" ) ; break ; default : output . append ( "" ) ; break ; } if ( this . qualification != null ) output . append ( this . qualification ) ; else output . append ( "*" ) ; output . append ( ">, type<" ) ; if ( this . simpleName != null ) output . append ( this . simpleName ) ; else output . append ( "*" ) ; output . append ( "> " ) ; return super . print ( output ) ; } } </s>