Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » finding the implementing interfaces of an IType
finding the implementing interfaces of an IType [message #99132] Fri, 26 September 2003 12:14 Go to next message
Genady Beryozkin is currently offline Genady BeryozkinFriend
Messages: 410
Registered: July 2009
Senior Member
Hi,

Suppose I have an instance of IType. I want to get the list of immediate
interfaces it implements. I found there are two options -
1. use IType#getSuperInterfaceNames() and then IType#resolveType()
2. use IType#newSupertypeHierarchy() and then
ITypeHierarchy#getSuperInterfaces

I found that these methods are too slow for me, because I invoke them on
almost all files in a java project.

Can anybody provide an insight on how to do perform this operation most
efficiently?

Thanks,
Genady
Re: finding the implementing interfaces of an IType [message #99213 is a reply to message #99132] Fri, 26 September 2003 13:42 Go to previous message
Jerome Lanneluc is currently offline Jerome LannelucFriend
Messages: 572
Registered: July 2009
Senior Member
You could build the type hierarchy once on the Java project using
IJavaProject.newTypeHierarchy(IRegion, IProgressMonitor) passing in a region
that contains the whole project. This will resolve the super types of all
types in the region only once.

Jerome

"Genady" <eclipse@genady.org> wrote in message
news:bl1ah2$fef$1@eclipse.org...
> Hi,
>
> Suppose I have an instance of IType. I want to get the list of immediate
> interfaces it implements. I found there are two options -
> 1. use IType#getSuperInterfaceNames() and then IType#resolveType()
> 2. use IType#newSupertypeHierarchy() and then
> ITypeHierarchy#getSuperInterfaces
>
> I found that these methods are too slow for me, because I invoke them on
> almost all files in a java project.
>
> Can anybody provide an insight on how to do perform this operation most
> efficiently?
>
> Thanks,
> Genady
>
Previous Topic:Ctrl+O extremally slow in I20030925
Next Topic:Source not found for RemoteTestRunner.run() line: 277
Goto Forum:
  


Current Time: Wed Jan 15 11:15:01 GMT 2025

Powered by FUDForum. Page generated in 0.02723 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top