Java Reference
In-Depth Information
Figure 3.22
The Implement Methods operation creates a
master list of all methods not yet implemented
that are defined by interfaces related to your
class, and allows you to choose any subset of
them to implement.
methods to implement, and click OK . IDEA will stub out the methods, using
default return values for primitives and nulls for objects. As with the Override
Methods command, select the Copy JavaDoc option if you want to duplicate the
JavaDoc from the interface or abstract method you're implementing.
3.7.6
Creating delegation methods
The Code | Delegate Methods command lets you create methods that delegate
behavior to one of your class's fields or methods. You generally create delegation
methods to access information or implement behavior that is a part of one of
your fields, without having to expose that field directly. To create a delegation
method, you select the field you want to delegate to and then the methods of that
object that you wish to delegate. Take for example figures 3.23 and 3.24, which
show both steps.
Figure 3.23
To delegate a series of methods through your
class to a contained object, IDEA first prompts
you to select the object to be delegated to.
 
 
 
 
Search WWH ::




Custom Search