-
Junior Member
Deledate method
hi plz help me
i got a question in interview that
what is delegate method. why it is used and to which it extends..
Last edited by kissuisin; 02-07-2008 at 10:09 PM.
Reason: title is wrong it is delegate method
-
Banned
Re: Deledate method
Delegate Methods
Eclim supports generation of delegate methods via the :JavaDelegate command. To utilize this functionality you must first place the cursor on a global field (in the main source file class or within an inner class), and then invoke the :JavaDelegate command.
In the following source, you can place the cursor anywhere starting from the first 'p' in private, to the trailing semicolon, and then invoke the :JavaDelegate command.
private List myList;
Invoking this command with the cursor on some other source element will generate the appropriate error.
Once successfully invoked, the result will be the opening of a lower window with all the methods that may be inserted that will delegate to the value of the field.
Here is a section of the content displayed when invoking the command on a field of type java.util.List like the one above.
com.test.TestList
package java.util;
public interface List
public abstract int size ()
public abstract boolean isEmpty ()
public abstract boolean contains (Object o)
public abstract Object[] toArray ()
...
From this newly opened window you can select a method by simply hitting with the cursor over the method signature and a delegate method will be created.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules