<s> package org . eclipse . jdt . internal . core ; import org . eclipse . jdt . core . * ; import org . eclipse . jdt . core . compiler . CharOperation ; public class TypeParameter extends SourceRefElement implements ITypeParameter { static final ITypeParameter [ ] NO_TYPE_PARAMETERS = new ITypeParameter [ 0 ] ; protected String name ; public TypeParameter ( JavaElement parent , String name ) { super ( parent ) ; this . name = name ; } public boolean equals ( Object o ) { if ( ! ( o instanceof TypeParameter ) ) return false ; return super . equals ( o ) ; } public String [ ] getBounds ( ) throws JavaModelException { TypeParameterElementInfo info = ( TypeParameterElementInfo ) getElementInfo ( ) ; return CharOperation . toStrings ( info . bounds ) ; } public String [ ] getBoundsSignatures ( ) throws JavaModelException { String [ ] boundSignatures = null ; TypeParameterElementInfo info = ( TypeParameterElementInfo ) this . getElementInfo ( ) ; if ( this . parent instanceof BinaryMember ) { char [ ] [ ] boundsSignatures = info . boundsSignatures ; if ( boundsSignatures == null || boundsSignatures . length == 0 ) { return CharOperation . NO_STRINGS ; } return CharOperation . toStrings ( info . boundsSignatures ) ; } char [ ] [ ] bounds = info . bounds ; if ( bounds == null || bounds . length == 0 ) { return CharOperation . NO_STRINGS ; } int boundsLength = bounds . length ; boundSignatures = new String [ boundsLength ] ; for ( int i = 0 ; i < boundsLength ; i ++ ) { boundSignatures [ i ] = new String ( Signature . createCharArrayTypeSignature ( bounds [ i ] , false ) ) ; } return boundSignatures ; } public IMember getDeclaringMember ( ) { return ( IMember ) getParent ( ) ; } public String getElementName ( ) { return this . name ; } public int getElementType ( ) { return TYPE_PARAMETER ; } protected char getHandleMementoDelimiter ( ) { return JavaElement . JEM_TYPE_PARAMETER ; } public ISourceRange getNameRange ( ) throws JavaModelException { SourceMapper mapper = getSourceMapper ( ) ; if ( mapper != null ) { ClassFile classFile = ( ClassFile ) getClassFile ( ) ; if ( classFile != null ) { classFile . getBuffer ( ) ; return mapper . getNameRange ( this ) ; } } TypeParameterElementInfo info = ( TypeParameterElementInfo ) getElementInfo ( ) ; return new SourceRange ( info . nameStart , info . nameEnd - info . nameStart + 1 ) ; } public ISourceRange getSourceRange ( ) throws JavaModelException { SourceMapper mapper = getSourceMapper ( ) ; if ( mapper != null ) { ClassFile classFile = ( ClassFile ) getClassFile ( ) ; if ( classFile != null ) { classFile . getBuffer ( ) ; return mapper . getSourceRange ( this ) ; } } return super . getSourceRange ( ) ; } public IClassFile getClassFile ( ) { return ( ( JavaElement ) getParent ( ) ) . getClassFile ( ) ; } protected void toStringName ( StringBuffer buffer ) { buffer . append ( '<' ) ; buffer . append ( getElementName ( ) ) ; buffer . append ( '>' ) ; } } </s>