<s> package org . eclipse . jdt . internal . core . hierarchy ; import org . eclipse . jdt . core . Signature ; import org . eclipse . jdt . core . compiler . CharOperation ; import org . eclipse . jdt . internal . compiler . ast . TypeDeclaration ; import org . eclipse . jdt . internal . compiler . classfmt . ClassFileConstants ; import org . eclipse . jdt . internal . compiler . env . IBinaryAnnotation ; import org . eclipse . jdt . internal . compiler . env . IBinaryField ; import org . eclipse . jdt . internal . compiler . env . IBinaryMethod ; import org . eclipse . jdt . internal . compiler . env . IBinaryNestedType ; import org . eclipse . jdt . internal . compiler . env . IBinaryType ; import org . eclipse . jdt . internal . core . search . indexing . IIndexConstants ; public class HierarchyBinaryType implements IBinaryType { private int modifiers ; private char [ ] sourceName ; private char [ ] name ; private char [ ] enclosingTypeName ; private char [ ] superclass ; private char [ ] [ ] superInterfaces = NoInterface ; private char [ ] [ ] typeParameterSignatures ; private char [ ] genericSignature ; public HierarchyBinaryType ( int modifiers , char [ ] qualification , char [ ] sourceName , char [ ] enclosingTypeName , char [ ] [ ] typeParameterSignatures , char typeSuffix ) { this . modifiers = modifiers ; this . sourceName = sourceName ; if ( enclosingTypeName == null ) { this . name = CharOperation . concat ( qualification , sourceName , '/' ) ; } else { this . name = CharOperation . concat ( qualification , '/' , enclosingTypeName , '$' , sourceName ) ; this . enclosingTypeName = CharOperation . concat ( qualification , enclosingTypeName , '/' ) ; CharOperation . replace ( this . enclosingTypeName , '.' , '/' ) ; } this . typeParameterSignatures = typeParameterSignatures ; CharOperation . replace ( this . name , '.' , '/' ) ; } public IBinaryAnnotation [ ] getAnnotations ( ) { return null ; } public char [ ] getEnclosingMethod ( ) { return null ; } public char [ ] getEnclosingTypeName ( ) { return this . enclosingTypeName ; } public IBinaryField [ ] getFields ( ) { return null ; } public char [ ] getFileName ( ) { return null ; } public char [ ] getGenericSignature ( ) { if ( this . typeParameterSignatures != null && this . genericSignature == null ) { StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( '<' ) ; for ( int i = 0 , length = this . typeParameterSignatures . length ; i < length ; i ++ ) { buffer . append ( this . typeParameterSignatures [ i ] ) ; } buffer . append ( '>' ) ; if ( this . superclass == null ) buffer . append ( Signature . createTypeSignature ( "" , true ) ) ; else buffer . append ( Signature . createTypeSignature ( this . superclass , true ) ) ; if ( this . superInterfaces != null ) for ( int i = 0 , length = this . superInterfaces . length ; i < length ; i ++ ) buffer . append ( Signature . createTypeSignature ( this . superInterfaces [ i ] , true ) ) ; this . genericSignature = buffer . toString ( ) . toCharArray ( ) ; CharOperation . replace ( this . genericSignature , '.' , '/' ) ; } return this . genericSignature ; } public char [ ] [ ] getInterfaceNames ( ) { return this . superInterfaces ; } public IBinaryNestedType [ ] getMemberTypes ( ) { return null ; } public IBinaryMethod [ ] getMethods ( ) { return null ; } public char [ ] [ ] [ ] getMissingTypeNames ( ) { return null ; } public int getModifiers ( ) { return this . modifiers ; } public char [ ] getName ( ) { return this . name ; } public char [ ] getSourceName ( ) { return this . sourceName ; } public char [ ] getSuperclassName ( ) { return this . superclass ; } public long getTagBits ( ) { return 0 ; } public boolean isAnonymous ( ) { return false ; } public boolean isBinaryType ( ) { return true ; } public boolean isLocal ( ) { return false ; } public boolean isMember ( ) { return false ; } public void recordSuperType ( char [ ] superTypeName , char [ ] superQualification , char superClassOrInterface ) { if ( superQualification != null ) { int length = superQualification . length ; if ( superQualification [ length - 1 ] == '$' ) { char [ ] enclosingSuperName = CharOperation . lastSegment ( superQualification , '.' ) ; superTypeName = CharOperation . concat ( enclosingSuperName , superTypeName ) ; superQualification = CharOperation . subarray ( superQualification , 0 , length - enclosingSuperName . length - 1 ) ; } } if ( superClassOrInterface == IIndexConstants . CLASS_SUFFIX ) { if ( TypeDeclaration . kind ( this . modifiers ) == TypeDeclaration . INTERFACE_DECL ) return ; char [ ] encodedName = CharOperation . concat ( superQualification , superTypeName , '/' ) ; CharOperation . replace ( encodedName , '.' , '/' ) ; this . superclass = encodedName ; } else { char [ ] encodedName = CharOperation . concat ( superQualification , superTypeName , '/' ) ; CharOperation . replace ( encodedName , '.' , '/' ) ; if ( this . superInterfaces == NoInterface ) { this . superInterfaces = new char [ ] [ ] { encodedName } ; } else { int length = this . superInterfaces . length ; System . arraycopy ( this . superInterfaces , 0 , this . superInterfaces = new char [ length + 1 ] [ ] , 0 , length ) ; this . superInterfaces [ length ] = encodedName ; } } } public char [ ] sourceFileName ( ) { return null ; } public String toString ( ) { StringBuffer buffer = new StringBuffer ( ) ; if ( this . modifiers == ClassFileConstants . AccPublic ) { buffer . append ( "public " ) ; } switch ( TypeDeclaration . kind ( this . modifiers ) ) { case TypeDeclaration . CLASS_DECL : buffer . append ( "class " ) ; break ; case TypeDeclaration . INTERFACE_DECL : buffer . append ( "interface " ) ; break ; case TypeDeclaration . ENUM_DECL : buffer . append ( "enum " ) ; break ; } if ( this . name != null ) { buffer . append ( this . name ) ; } if ( this . superclass != null ) { buffer . append ( "n extends " ) ; buffer . append ( this . superclass ) ; } int length ; if ( this . superInterfaces != null && ( length = this . superInterfaces . length ) != 0 ) { buffer . append ( "" ) ; for ( int i = 0 ; i < length ; i ++ ) { buffer . append ( this . superInterfaces [ i ] ) ; if ( i != length - 1 ) { buffer . append ( ", " ) ; } } } return buffer . toString ( ) ; } } </s>