@Override public ITypeParameter getTypeParameter(String typeParameterName) { return new TypeParameter(this, typeParameterName); } /**
@Override protected void toStringName(StringBuffer buffer) { buffer.append('<'); buffer.append(getElementName()); buffer.append('>'); } }
@Override public IMember getDeclaringMember() { return (IMember) getParent(); }
public ISourceRange getNameRange() throws JavaModelException { SourceMapper mapper= getSourceMapper(); if (mapper != null) { // ensure the class file's buffer is open so that source ranges are computed 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); }
/** * @see IMethod#getTypeParameterSignatures() * @since 3.0 * @deprecated */ public String[] getTypeParameterSignatures() throws JavaModelException { ITypeParameter[] typeParameters = getTypeParameters(); int length = typeParameters.length; String[] typeParameterSignatures = new String[length]; for (int i = 0; i < length; i++) { TypeParameter typeParameter = (TypeParameter) typeParameters[i]; TypeParameterElementInfo info = (TypeParameterElementInfo) typeParameter.getElementInfo(); char[][] bounds = info.bounds; if (bounds == null) { typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameter.getElementName(), CharOperation.NO_STRINGS); } else { int boundsLength = bounds.length; char[][] boundSignatures = new char[boundsLength][]; for (int j = 0; j < boundsLength; j++) { boundSignatures[j] = Signature.createCharArrayTypeSignature(bounds[j], false); } typeParameterSignatures[i] = new String(Signature.createTypeParameterSignature(typeParameter.getElementName().toCharArray(), boundSignatures)); } } return typeParameterSignatures; }
public ISourceRange getSourceRange() throws JavaModelException { SourceMapper mapper= getSourceMapper(); if (mapper != null) { // ensure the class file's buffer is open so that source ranges are computed ClassFile classFile = (ClassFile)getClassFile(); if (classFile != null) { classFile.getBuffer(); return mapper.getSourceRange(this); } } return super.getSourceRange(); }
@Override public String[] getBounds() throws JavaModelException { TypeParameterElementInfo info = (TypeParameterElementInfo) getElementInfo(); return CharOperation.toStrings(info.bounds); }
protected void closing(Object info) throws JavaModelException { super.closing(info); SourceTypeElementInfo elementInfo = (SourceTypeElementInfo) info; ITypeParameter[] typeParameters = elementInfo.typeParameters; for (int i = 0, length = typeParameters.length; i < length; i++) { ((TypeParameter) typeParameters[i]).close(); } } /**
/** * {@inheritDoc} * @since 3.7 */ @Override public ITypeRoot getTypeRoot() { return this.getDeclaringMember().getTypeRoot(); }
static class IntArrayList { public int[] list = new int[5]; public int length = 0; public void add(int i) { if (this.list.length == this.length) { System.arraycopy(this.list, 0, this.list = new int[this.length*2], 0, this.length); } this.list[this.length++] = i; } }
public ISourceRange getNameRange() throws JavaModelException { SourceMapper mapper= getSourceMapper(); if (mapper != null) { // ensure the class file's buffer is open so that source ranges are computed 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); }
/** * @see IType#getTypeParameterSignatures() * @since 3.0 */ @Override public String[] getTypeParameterSignatures() throws JavaModelException { ITypeParameter[] typeParameters = getTypeParameters(); int length = typeParameters.length; String[] typeParameterSignatures = new String[length]; for (int i = 0; i < length; i++) { TypeParameter typeParameter = (TypeParameter) typeParameters[i]; TypeParameterElementInfo info = (TypeParameterElementInfo) typeParameter.getElementInfo(); char[][] bounds = info.bounds; if (bounds == null) { typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameter.getElementName(), CharOperation.NO_STRINGS); } else { int boundsLength = bounds.length; char[][] boundSignatures = new char[boundsLength][]; for (int j = 0; j < boundsLength; j++) { boundSignatures[j] = Signature.createCharArrayTypeSignature(bounds[j], false); } typeParameterSignatures[i] = new String(Signature.createTypeParameterSignature(typeParameter.getElementName().toCharArray(), boundSignatures)); } } return typeParameterSignatures; }
public ISourceRange getSourceRange() throws JavaModelException { SourceMapper mapper= getSourceMapper(); if (mapper != null) { // ensure the class file's buffer is open so that source ranges are computed ClassFile classFile = (ClassFile)getClassFile(); if (classFile != null) { classFile.getBuffer(); return mapper.getSourceRange(this); } } return super.getSourceRange(); }
public String[] getBounds() throws JavaModelException { TypeParameterElementInfo info = (TypeParameterElementInfo) getElementInfo(); return CharOperation.toStrings(info.bounds); }
protected void closing(Object info) throws JavaModelException { super.closing(info); SourceMethodElementInfo elementInfo = (SourceMethodElementInfo) info; ITypeParameter[] typeParameters = elementInfo.typeParameters; for (int i = 0, length = typeParameters.length; i < length; i++) { ((TypeParameter) typeParameters[i]).close(); } } public boolean equals(Object o) {
/** * {@inheritDoc} * @since 3.7 */ public ITypeRoot getTypeRoot() { return this.getDeclaringMember().getTypeRoot(); }
static class IntArrayList { public int[] list = new int[5]; public int length = 0; public void add(int i) { if (this.list.length == this.length) { System.arraycopy(this.list, 0, this.list = new int[this.length*2], 0, this.length); } this.list[this.length++] = i; } }
public ISourceRange getNameRange() throws JavaModelException { SourceMapper mapper= getSourceMapper(); if (mapper != null) { // ensure the class file's buffer is open so that source ranges are computed 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); }
/** * @see IType#getTypeParameterSignatures() * @since 3.0 */ public String[] getTypeParameterSignatures() throws JavaModelException { ITypeParameter[] typeParameters = getTypeParameters(); int length = typeParameters.length; String[] typeParameterSignatures = new String[length]; for (int i = 0; i < length; i++) { TypeParameter typeParameter = (TypeParameter) typeParameters[i]; TypeParameterElementInfo info = (TypeParameterElementInfo) typeParameter.getElementInfo(); char[][] bounds = info.bounds; if (bounds == null) { typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameter.getElementName(), CharOperation.NO_STRINGS); } else { int boundsLength = bounds.length; char[][] boundSignatures = new char[boundsLength][]; for (int j = 0; j < boundsLength; j++) { boundSignatures[j] = Signature.createCharArrayTypeSignature(bounds[j], false); } typeParameterSignatures[i] = new String(Signature.createTypeParameterSignature(typeParameter.getElementName().toCharArray(), boundSignatures)); } } return typeParameterSignatures; }
protected TypeParameter createTypeParameter(JavaElement parent, String name) { return new TypeParameter(parent, name); } /**